wp_reset_postdata

函数


wp_reset_postdata ( No parameters )
定义位置
  • wp-includes/query.php
    , line 126
引入
3.0.0
弃用

After looping through a separate query, this function restores
the $post global to the current post in the main query.

function wp_reset_postdata() {
	global $wp_query;

	if ( isset( $wp_query ) ) {
		$wp_query->reset_postdata();
	}
}