[wp-cvs]
wordpress/wp-includes classes.php, 1.42, 1.43 functions.php,
1.235, 1.236 template-functions-general.php, 1.63, 1.64
Ryan Boren
rboren at users.sourceforge.net
Wed Jan 19 02:21:39 GMT 2005
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9192
Modified Files:
classes.php functions.php template-functions-general.php
Log Message:
Deprecate start_wp(). Move start_wp functionality to setup_postdata(). Add the_post() method to WP_Query.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.235
retrieving revision 1.236
diff -C2 -d -r1.235 -r1.236
*** functions.php 11 Jan 2005 17:07:54 -0000 1.235
--- functions.php 19 Jan 2005 02:21:36 -0000 1.236
***************
*** 797,809 ****
}
! function start_wp($use_wp_query = false) {
! global $post, $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages, $wp_query;
! global $pagenow;
! if ($use_wp_query) {
! $post = $wp_query->next_post();
! } else {
! $wp_query->next_post();
! }
if (!$preview) {
--- 797,814 ----
}
! // Deprecated. Use the new post loop.
! function start_wp() {
! global $wp_query, $post;
! // Since the old style loop is being used, advance the query iterator here.
! $wp_query->next_post();
!
! setup_postdata($post);
! }
!
! // Setup global post data.
! function setup_postdata($post) {
! global $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages, $wp_query;
! global $pagenow;
if (!$preview) {
***************
*** 832,840 ****
$more = 1;
$content = $post->post_content;
! if (preg_match('/<!--nextpage-->/', $post->post_content)) {
if ($page > 1)
$more = 1;
$multipage = 1;
- $content = $post->post_content;
$content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content);
$content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content);
--- 837,844 ----
$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);
***************
*** 1241,1245 ****
function the_post() {
! start_wp(true);
}
--- 1245,1250 ----
function the_post() {
! global $wp_query;
! $wp_query->the_post();
}
Index: template-functions-general.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/template-functions-general.php,v
retrieving revision 1.63
retrieving revision 1.64
diff -C2 -d -r1.63 -r1.64
*** template-functions-general.php 9 Jan 2005 02:40:06 -0000 1.63
--- template-functions-general.php 19 Jan 2005 02:21:36 -0000 1.64
***************
*** 608,623 ****
function get_the_time( $d = '' ) {
if ( '' == $d )
! $the_time = date( get_settings('time_format'), get_post_time() );
else
! $the_time = date( $d, get_post_time() );
return apply_filters('get_the_time', $the_time);
}
! function get_post_time( $gmt = false ) { // returns timestamp
global $post;
if ( $gmt )
! $time = mysql2date('U', $post->post_date_gmt);
else
! $time = mysql2date('U', $post->post_date);
return apply_filters('get_the_time', $time);
}
--- 608,625 ----
function get_the_time( $d = '' ) {
if ( '' == $d )
! $the_time = get_post_time(get_settings('time_format'));
else
! $the_time = get_post_time($d);
return apply_filters('get_the_time', $the_time);
}
! function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp
global $post;
if ( $gmt )
! $time = $post->post_date_gmt;
else
! $time = $post->post_date;
!
! $time = mysql2date($d, $time);
return apply_filters('get_the_time', $time);
}
Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.42
retrieving revision 1.43
diff -C2 -d -r1.42 -r1.43
*** classes.php 31 Dec 2004 21:49:48 -0000 1.42
--- classes.php 19 Jan 2005 02:21:36 -0000 1.43
***************
*** 572,575 ****
--- 572,581 ----
}
+ function the_post() {
+ global $post;
+ $post = $this->next_post();
+ setup_postdata($post);
+ }
+
function have_posts() {
if ($this->current_post + 1 < $this->post_count) {
More information about the cvs
mailing list