Move user functions to user.php. Relocate more post functions to post.php. #2525

git-svn-id: https://develop.svn.wordpress.org/trunk@3854 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2006-06-08 02:22:16 +00:00
parent 5f264096d8
commit 1041498585
6 changed files with 288 additions and 268 deletions
+38
View File
@@ -1037,4 +1037,42 @@ class WP_Query {
}
}
//
// Private helper functions
//
// Setup global post data.
function setup_postdata($post) {
global $id, $postdata, $authordata, $day, $page, $pages, $multipage, $more, $numpages, $wp_query;
global $pagenow;
$id = $post->ID;
$authordata = get_userdata($post->post_author);
$day = mysql2date('d.m.y', $post->post_date);
$currentmonth = mysql2date('m', $post->post_date);
$numpages = 1;
$page = get_query_var('page');
if ( !$page )
$page = 1;
if ( is_single() || is_page() )
$more = 1;
$content = $post->post_content;
if ( preg_match('/<!--nextpage-->/', $content) ) {
if ( $page > 1 )
$more = 1;
$multipage = 1;
$content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
$content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
$content = str_replace("<!--nextpage-->\n", '<!--nextpage-->', $content);
$pages = explode('<!--nextpage-->', $content);
$numpages = count($pages);
} else {
$pages[0] = $post->post_content;
$multipage = 0;
}
return true;
}
?>