Advertisement
fauzanjeg

JKIT || Fix Post Block Filter for Custom Post Type

Mar 31st, 2022
1,620
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. /** Fix Post Block Filter for Custom Post Type */
  2. remove_filter( 'jeg_accept_query_attribute', 'jeg_accept_query_attr_custom_term', 10 );
  3. function fix_post_block_cpt_filter( $accepted, $attr ) {
  4.     $taxonomies = get_object_taxonomies( $attr['post_type'] );
  5.  
  6.     if ( $taxonomies ) {
  7.         $accepted = array_merge( $taxonomies, $accepted );
  8.     }
  9.  
  10.     return $accepted;
  11. }
  12. add_filter( 'jeg_accept_query_attribute', 'fix_post_block_cpt_filter', 99, 2 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement