Set up global post data.

Signature

setup_postdata( $post )
post
 (object) Post data.

Return

(boolean) True when finished.

Source

function setup_postdata( $post ) {
	global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;

	$id = (int) $post->ID;

	$authordata = get_userdata($post->post_author);

	$currentday = mysql2date('d.m.y', $post->post_date, false);
	$currentmonth = mysql2date('m', $post->post_date, false);
	$numpages = 1;
	$multipage = 0;
	$page = get_query_var('page');
	if ( ! $page )
		$page = 1;
	if ( is_single() || is_page() || is_feed() )
		$more = 1;
	$content = $post->post_content;
	if ( false !== strpos( $content, '<!--nextpage-->' ) ) {
		if ( $page > 1 )
			$more = 1;
25 more lines...
WP Trac GitHub

Link here