Posts

solution

Here's an example implementation of this solution: public function test_get_pages_with_taxonomy_on_page() { wp_set_current_user( 1 ); register_taxonomy( 'language', 'page' ); $term_en = self::factory()->term->create( array( 'taxonomy' => 'language', 'name' => 'english' ) ); $term_fr = self::factory()->term->create( array( 'taxonomy' => 'language', 'name' => 'french' ) ); $page_en = self::factory()->post->create( array( 'post_type' => 'page', 'tax_input' => array( 'language' => array( $term_en ) ) ) ); $page_fr = self::factory()->post->create( array( 'post_type' => 'page', 'tax_input' => array( 'language' => array( $term_fr ) ) ) ); add_filter( 'get_pages_query_args', function ( $query_args, $r ) { $query_args['tax_