Tristan
Forum Replies Created
-
That seems to have fixed it – thanks!
Forum: Plugins
In reply to: [WP Super Cache] Compatibility with PHP 8.1Having this same issue.
Resolved in my own project by changing the reported line from
if ( strstr( $uri, $u ) ) {
to
if ( strstr( $uri ?: '', $u ) ) {
Maybe not the tidiest solution, but replaces any ‘null’ instance with a string as desired.
Forum: Plugins
In reply to: [AI Engine] o.9.92 cause a blank setting pageI’m still getting the same blank admin page with 0.9.94, though only in debug mode. Console only displays
JQMIGRATE: Migrate is installed, version 3.3.2
The following is displayed on the front-end where the chatbot is used:
Warning: Undefined array key “icon” in?[…]/wp-content/plugins/ai-engine/classes/modules/chatbot.php?on line?229
Hi @dcooney,
I’ve updated to the latest version and it looks like the issue is indeed resolved.
Many thanks,
Forum: Reviews
In reply to: [Phoenix Media Rename] Almost perfect, but serialization is buggyForum: Plugins
In reply to: [Code Snippets] “The plugin does not have a valid header.”Update: Just tried activating from the Installed Plugins page and that worked for me.
Forum: Plugins
In reply to: [Code Snippets] “The plugin does not have a valid header.”I’ve just had the same error message.
The plugin installed successfully but failed to activate.
Forum: Plugins
In reply to: [Code Snippets] Hooks not activating in certain casesOkay, so it was an AJAX problem.
Basically, the AJAX requests were being treated as if on an admin page:
Forum: Plugins
In reply to: [Code Snippets] Hooks not activating in certain casesI figured it out.
I set the snippet to only run on the site front end, and this caused the hooks to stop working. The same thing happens in ‘functions.php’ when using
is_admin()
.Still not sure why it’s happening, but it’s not a plugin issue so I’ll mark this as resolved.
Forum: Plugins
In reply to: [Code Snippets] Hooks not activating in certain casesI’ve simplified the functions way down to the following.
It’s now at least doing something, so that’s a start. I’ll have to look into this further another day.
Thanks for your help!
/* Hide products in excluded categories in post queries */ add_action( 'pre_get_posts', function ( $query ) { $parent_term_id = 106; $query->set( 'cat', $parent_term_id ); } ); /* Hide products in excluded categories in AJAX Load More queries */ add_filter( 'alm_query_args_products_list', function ( $args, $id ) { $parent_term_id = 106; $args['cat'] = $parent_term_id; return $args; }, 10, 2 );
Forum: Plugins
In reply to: [Code Snippets] Hooks not activating in certain casesHere are the two hook functions, both serving the same purpose, which is to hide all
product
-type posts in certain categories./* Hide products in excluded categories in post queries */ function hide_excluded_products( $query ) { $parent_term_id = 106; if ( !$query->get('post_type') == 'product' || ( $query->get('tax_query') && $query->get('tax_query')[0]['terms'] == $parent_term_id ) ) return; $excluded_post_ids = new WP_Query( array( 'post_type' => 'product', 'fields' => 'ids', 'tax_query' => array( array( 'taxonomy' => 'product_category', 'field' => 'term_id', 'terms' => $parent_term_id, 'operator' => 'IN', ), ), ) ); $query->set( 'post__not_in', array_merge( $query->get('post__not_in') ?: array(), $excluded_post_ids->posts ) ); } add_action( 'pre_get_posts', 'hide_excluded_products' ); /* Hide products in excluded categories in AJAX Load More queries */ function alm_hide_excluded_products( $args, $id ) { $parent_term_id = 106; if ( !$args['tax_query'] || $args['tax_query'][0]['terms'] != $parent_term_id ) { $excluded_post_ids = new WP_Query( array( 'post_type' => 'product', 'fields' => 'ids', 'tax_query' => array( array( 'taxonomy' => 'product_category', 'field' => 'term_id', 'terms' => $parent_term_id, 'operator' => 'IN', ), ), ) ); $args['post__not_in'] = array_merge($args['post__not_in'] ?: array(), $excluded_post_ids->posts); } return $args; } add_filter( 'alm_query_args_products_list', 'alm_hide_excluded_products', 10, 2);
Honestly, the content of the functions is probably irrelevant as I’m pretty sure the functions aren’t being called at all.
I can also confirm that the first hook does work when using
get_posts()
without AJAX.Cool, thanks!
Forum: Plugins
In reply to: [Advanced Custom Fields: Extended] Individual subfields not working on formsI was not aware of the Column field – that helps a lot!
Thanks!
Forum: Plugins
In reply to: [String locator] Editor removes backslashes when savingThanks for the update! Will let you know if anything else comes up.
Forum: Plugins
In reply to: [Site Reviews] Get all reviews but omit trashed reviewsWorks great now, thanks!