P.E.A. Lutz
Forum Replies Created
-
Yes. You can control how the Query Loop block queries and sorts posts using the
query_loop_block_query_varsfilter.Add the following code to your site plugin, theme’s
functions.php, or a snippets plugin:function query_loop_vars( $query, $block, $page ) {
if ( 'event' === $query['post_type'] ) {
$query['orderby'] = 'meta_value';
$query['meta_key'] = '_event_end';
$query['order'] = 'DESC';
}
return $query;
}
add_filter( 'query_loop_block_query_vars', 'query_loop_vars', 10, 3 );This example sorts event posts by a custom meta field (
_event_end) instead of publish date. The same filter can be used to modify other query parameters as needed.Ref: https://developer.ww.wp.xz.cn/reference/hooks/query_loop_block_query_vars/
- This reply was modified 7 months, 2 weeks ago by P.E.A. Lutz.
Forum: Fixing WordPress
In reply to: Scheduled posts do publish but the slug is missingThere is a response from @ivoreis82 in this thread:
https://ww.wp.xz.cn/support/topic/wpml-issue-with-eventsmanager/#post-18695558Forum: Fixing WordPress
In reply to: Scheduled posts do publish but the slug is missingI posted my solution to this issue here: https://ww.wp.xz.cn/support/topic/wpml-issue-with-eventsmanager/#post-18664590
I posted my solution to this issue here: https://ww.wp.xz.cn/support/topic/wpml-issue-with-eventsmanager/#post-18664590
The problem isn’t the
ifcheck, it’s that$is_post_typeisn’t a boolean. Since it usually holds a non-empty string, the condition runs for post types outside Events Manager. The code suggested earlier “works” but it edits plugin files directly and makes$is_post_typepull double duty.A safer fix is to unhook EM’s handler and replace it with a wrapper that sets
$is_post_typeas a true/false value. This way the condition works exactly as intended — only for repeating archetypes — and you don’t have to edit plugin files (so the fix survives updates).Drop this into your theme’s
functions.phpor, better, a small MU-plugin:/**
* Remove EM's default handler and reattach our own.
*
* @return void
*/
function em_fix_future_publish_scope() {
remove_action(
'publish_future_post',
array( 'EM_Event_Post', 'publish_future_post' ),
10
);
add_action( 'publish_future_post', 'em_future_publish_handler', 10, 1 );
}
add_action( 'plugins_loaded', 'em_fix_future_publish_scope', 20 );
/**
* Replacement handler for scheduled publish.
*
* @param int $post_id Post ID being published by WP-Cron.
* @return void
*/
function em_future_publish_handler( $post_id ) {
global $EM_Event;
$post_type = get_post_type( $post_id );
// Corrected boolean check: true if this post type is a repeating archetype managed by EM.
$is_post_type = (bool) Archetypes::is_repeating( $post_type ) && Archetypes::get_repeating_archetype( $post_type );
$saving_status = ! in_array( get_post_status( $post_id ), array( 'trash', 'auto-draft' ), true )
&& ! defined( 'DOING_AUTOSAVE' );
if ( ! defined( 'UNTRASHING_' . $post_id ) && $is_post_type && $saving_status ) {
$EM_Event = em_get_event( $post_id, 'post_id' );
if ( $EM_Event instanceof \EM_Event ) {
$EM_Event->set_status( 1 );
}
}
}Why this is better
$is_post_typeis now a proper boolean, not a string.- The
ifguard works as intended: only runs for EM repeating archetypes. - No need to edit plugin files — this survives plugin updates.
- Clearer, easier to maintain, and future-proof against Archetypes changes.
Forum: Plugins
In reply to: [reCAPTCHA for WooCommerce] Identification for Tables in the database@ghulamjafar2
If you know the names of the tables, you can search this site to find the plugin that created it.
https://plugintests.com/search-idsIf this error only occurs when the option “Include Form Styling: No styling”, the issue may simply be the
divthat contains that text isn’t hidden because the plugin’s CSS is disabled.I added CSS to the class
.wpforms-hiddento hide the text. The form is working as expected.<div class="wpforms-hidden" id="wpforms-error-noscript">
Please enable JavaScript in your browser to complete this form.
</div>I am experiencing the same issue. There are around 3K posts on the site and many of the posts do not show up in the drop-down, even if exact title is entered. Additionally, the posts are returned in admin searches and front-end site searches.
There is no console error when searching. However, if I enter from the Include Posts field (without any selected posts), there is a console error:
Uncaught TypeError: t is undefined
include_posts .../wp-content/plugins/advanced-query-loop/build/variations.js?ver=02d8ea1813ee567a1cd0:1
include_posts .../wp-content/plugins/advanced-query-loop/build/variations.js?ver=02d8ea1813ee567a1cd0:1
onChange .../wp-content/plugins/advanced-query-loop/build/variations.js?ver=02d8ea1813ee567a1cd0:1I can confirm that posts are returned in REST API.
/wp-json/wp/v2/posts/?search={Post Title}/wp-json/wp/v2/posts/?search={Post Title}&search_columns=post_title- This reply was modified 1 year, 9 months ago by P.E.A. Lutz. Reason: Added more info about REST API results
I also encountered the issue in which the form itself displayed “Please enable JavaScript in your browser to complete this form.”
For me, it was resolved by disabling “Use Modern Markup” in Settings > GeneralForum: Plugins
In reply to: [Events Manager - Zoom Integration] Still not connectedAny update on this?
We’re also not able to connect:
(object) array( 'code' => 124, 'message' => 'Invalid access token, this access token is not supported as query parameter string.', )Recurring events are not really “events”, they act more as a grouping or parent for the occurrences (events) of the recurring event. By default, the events listing will show each occurrence as a separate event.
Are you looking to show a list of events that are occurrences of a recurring event or are you looking to show the recurring events as list?
Both are possible.
You can either use a built-in template tag or shortcode to display the events.
Template Tag
em_events( $args )orem_get_events( $args )https://wp-events-plugin.com/documentation/template-tags/
Shortcode
[events_list]https://wp-events-plugin.com/documentation/shortcodes/
To display only events that are occurrences of a recurring event:
em_events( array( 'recurrences' => 1 ) );[events_list recurrences=1]To display only events that are occurrences of a recurring event and grouped by recurring event id
em_events( array( 'recurrences' => 1, 'groupby' => 'recurring_id' ) );[events_list recurrences=1 groupby='recurring_id']To display recurring events.
em_events( array( 'recurring' => 1, ) );[events_list recurring=1]See full list of search attributes here:
https://wp-events-plugin.com/documentation/event-search-attributes/
- This reply was modified 3 years, 4 months ago by P.E.A. Lutz.
- This reply was modified 3 years, 4 months ago by Steven Stern (sterndata).
Forum: Plugins
In reply to: [Events Manager - Calendar, Bookings, Tickets, and more!] Show in Rest API?The block editor (Rest API) can be enabled for
event,recurring-eventandlocationpost types by setting theEM_GUTENBERGconstant totrue.define( 'EM_GUTENBERG', true );This doesn’t appear to enable for
event-tagsorevent-categoriestaxonomies.The plugin provides filter hooks for event taxonomies.
apply_filters( 'em_ct_tags', array $args );apply_filters( 'em_ct_categories', array $args );Usage
if ( defined( 'EM_GUTENBERG' ) && EM_GUTENBERG ) { add_filter( 'em_ct_tags', 'enable_block_editor' ); add_filter( 'em_ct_categories', 'enable_block_editor' ); } /** * Enable Rest API for Event Taxonomies * * @param array $args * @return array $args modified array */ function enable_block_editor( $args ) { $args['show_in_rest'] = true; return $args; }Wanted to follow up on this…
Any help on why recurring Zoom events are being created in Zoom with the event date/time set to creation date/time?
Forum: Plugins
In reply to: [WP User Avatars] WebP SupportThis is duplicated in GitHub Issues here: https://github.com/stuttter/wp-user-avatars/issues/28
Please feel free to close this if GitHub is the preferred place for support.
Forum: Plugins
In reply to: [Co-Authors Plus] Newest update making links appear as plain textI can confirm that 3.4.7 resolves the issue for me.