diff options
| author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-13 11:18:16 +0000 |
|---|---|---|
| committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2006-06-13 11:18:16 +0000 |
| commit | 19b51f30bd324ecb36f99d159947b75c22b6fecf (patch) | |
| tree | 9423e53c5fddbfca6e4cd05f43c4e1e11bc508b4 /wp-inst/wp-includes/query.php | |
| parent | 242d432d82cefdf3aab7135b5298c2db02c9114c (diff) | |
| download | wordpress-mu-19b51f30bd324ecb36f99d159947b75c22b6fecf.tar.gz wordpress-mu-19b51f30bd324ecb36f99d159947b75c22b6fecf.tar.xz wordpress-mu-19b51f30bd324ecb36f99d159947b75c22b6fecf.zip | |
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@559 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/query.php')
| -rw-r--r-- | wp-inst/wp-includes/query.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/wp-inst/wp-includes/query.php b/wp-inst/wp-includes/query.php index 510a7ab..305c7e1 100644 --- a/wp-inst/wp-includes/query.php +++ b/wp-inst/wp-includes/query.php @@ -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;
+}
+
?>
|
