Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 59525

Just a question about wp_reset_postdata()

$
0
0

Replies: 0

Hi @obenland,

I’m wondering for the reason why wp_reset_postdata() is not being used like so:

$query = new WP_Query( $query_args );
if ( $query->posts ) {
$results = apply_filters( 'wpss_search_results', wp_list_pluck( $query->posts, 'post_title' ), $query );
echo wp_kses_post( join( $results, "\n" ) );
wp_reset_postdata();
		}
		
		wp_die();

Is it because it’s a ajax call? or because the WP_Query is not being modified? or..?

Thanks!

  • This topic was modified 6 minutes ago by wpfed.

Viewing all articles
Browse latest Browse all 59525

Trending Articles