File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2407,12 +2407,16 @@ public function get_posts() {
24072407 }
24082408
24092409 if ( ! empty ( $ query_vars ['author__not_in ' ] ) ) {
2410- if ( is_array ( $ query_vars ['author__not_in ' ] ) ) {
2411- $ query_vars ['author__not_in ' ] = array_unique ( array_map ( 'absint ' , $ query_vars ['author__not_in ' ] ) );
2412- sort ( $ query_vars ['author__not_in ' ] );
2410+ $ author__not_in_id_list = wp_parse_id_list ( $ query_vars ['author__not_in ' ] );
2411+ if ( count ( $ author__not_in_id_list ) > 0 ) {
2412+ sort ( $ author__not_in_id_list );
2413+ $ where .= sprintf (
2414+ " AND {$ wpdb ->posts }.post_author NOT IN (%s) " ,
2415+ implode ( ', ' , $ author__not_in_id_list )
2416+ );
2417+ /** Update the query var for stable cache key generation in {@see self::generate_cache_key()}. */
2418+ $ query_vars ['author__not_in ' ] = $ author__not_in_id_list ;
24132419 }
2414- $ author__not_in = implode ( ', ' , (array ) $ query_vars ['author__not_in ' ] );
2415- $ where .= " AND {$ wpdb ->posts }.post_author NOT IN ( $ author__not_in) " ;
24162420 } elseif ( ! empty ( $ query_vars ['author__in ' ] ) ) {
24172421 if ( is_array ( $ query_vars ['author__in ' ] ) ) {
24182422 $ query_vars ['author__in ' ] = array_unique ( array_map ( 'absint ' , $ query_vars ['author__in ' ] ) );
You can’t perform that action at this time.
0 commit comments