• Resolved Lukasz

    (@wpfed)


    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 5 years, 5 months ago by Lukasz.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Just a question about wp_reset_postdata()’ is closed to new replies.