@@ -601,14 +601,19 @@ private function process_parent_assets( $parent_id, $callback ) {
601601 return ;
602602 }
603603
604- $ query_args = array (
604+ $ query_args = array (
605605 'post_type ' => self ::POST_TYPE_SLUG ,
606606 'posts_per_page ' => 100 ,
607607 'post_parent ' => $ parent_id ,
608608 'post_status ' => array ( 'inherit ' , 'draft ' ),
609609 'fields ' => 'ids ' ,
610610 'update_post_meta_cache ' => false ,
611611 'update_post_term_cache ' => false ,
612+ // Internal bookkeeping query over our own post type: do not run
613+ // third-party content filters (e.g. `the_posts`) meant for
614+ // public-facing queries. The query is fully specified, so the
615+ // filters VIP protects (posts_where/join/orderby) are not relied on.
616+ 'suppress_filters ' => true , // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters
612617 );
613618 $ query = new \WP_Query ( $ query_args );
614619 $ previous_total = $ query ->found_posts ;
@@ -987,6 +992,11 @@ protected function init_asset_parents() {
987992 'no_found_rows ' => true ,
988993 'update_post_meta_cache ' => false ,
989994 'update_post_term_cache ' => false ,
995+ // Internal bookkeeping query over our own post type: do not run
996+ // third-party content filters (e.g. `the_posts`) meant for
997+ // public-facing queries. The query is fully specified, so the
998+ // filters VIP protects (posts_where/join/orderby) are not relied on.
999+ 'suppress_filters ' => true , // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.SuppressFilters_suppress_filters
9901000 );
9911001 $ query = new \WP_Query ( $ args );
9921002 $ this ->asset_parents = array ();
0 commit comments