mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user