ajax stopped working when not logged in wordpress

Try to output the debug query Find fragment $the_query = new WP_Query( array( ‘posts_per_page’ => 5, ‘s’ => esc_attr( $_POST[‘keyword’] ) ) ); if( $the_query->have_posts() ) : Replaced by $the_query = new WP_Query( array( ‘posts_per_page’ => 5, ‘s’ => esc_attr( $_POST[‘keyword’] ) ) ); echo (string)$the_query->request; if( $the_query->have_posts() ) : Perhaps some hooks are triggered … Read more

Where do I hook to have the server do something in PHP on block attribute change?

I’m not sure that I understood exactly your goal, but check if hooking to render_block does what you want, as it will modify the block’s output before it gets rendered in the frontend. Usage example: add_filter( ‘render_block’, ‘my_dynamic_data’, 10, 2 ); function my_dynamic_data( $block_content, $block ) { if(‘my_value’ === $block[‘attrs’][‘myAttribute’] ) { // Do something … Read more

How do I add filter with woocommerce categories?

I was missing the condition for the array inside the tax_query array. It is important to have it regardless if you have one or more conditions. $term_search = get_queried_object()->slug; // WP_Query arguments $args = array( ‘p’ => ‘product’, ‘post_type’ => array( ‘product’ ), ‘order’ => ‘ASC’, ‘post_per_page’ => 20, ‘tax_query’ => array(array( ‘taxonomy’ => ‘product_cat’, … Read more