How to make plugin work with query block
-
Shadow Terms is a really cool developer tool, but out-of-the-box it doesn’t work with the query block because the ‘publicly_queryable’ argument is set to false for the ’connect’ taxonomy.
Luckily this argument can be changed by the built-in filter, so it’s not a big deal. So if you want to be able to filter by taxonomy in the query block, you will need to add something like this.
function wp_docs_shadow_taxonomy_args( $args, $post_type ) {
// Target your post type
if ( 'your_post_type' !== $post_type ) {
return $args;
}
// Set as publicly queryable
$args['publicly_queryable'] = true;
// Return
return $args;
}
add_filter( 'shadow_terms_register_taxonomy_args', 'wp_docs_shadow_taxonomy_args', 10, 2 );
- You must be logged in to reply to this topic.