Changeset 2104
- Timestamp:
- 01/19/05 02:21:36 (4 years ago)
- Files:
-
- trunk/wp-includes/classes.php (modified) (1 diff)
- trunk/wp-includes/functions.php (modified) (3 diffs)
- trunk/wp-includes/template-functions-general.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-includes/classes.php
r2026 r2104 570 570 $this->post = $this->posts[$this->current_post]; 571 571 return $this->post; 572 } 573 574 function the_post() { 575 global $post; 576 $post = $this->next_post(); 577 setup_postdata($post); 572 578 } 573 579 trunk/wp-includes/functions.php
r2081 r2104 797 797 } 798 798 799 function start_wp($use_wp_query = false) { 800 global $post, $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages, $wp_query; 799 // Deprecated. Use the new post loop. 800 function start_wp() { 801 global $wp_query, $post; 802 803 // Since the old style loop is being used, advance the query iterator here. 804 $wp_query->next_post(); 805 806 setup_postdata($post); 807 } 808 809 // Setup global post data. 810 function setup_postdata($post) { 811 global $id, $postdata, $authordata, $day, $preview, $page, $pages, $multipage, $more, $numpages, $wp_query; 801 812 global $pagenow; 802 803 if ($use_wp_query) {804 $post = $wp_query->next_post();805 } else {806 $wp_query->next_post();807 }808 813 809 814 if (!$preview) { … … 832 837 $more = 1; 833 838 $content = $post->post_content; 834 if (preg_match('/<!--nextpage-->/', $ post->post_content)) {839 if (preg_match('/<!--nextpage-->/', $content)) { 835 840 if ($page > 1) 836 841 $more = 1; 837 842 $multipage = 1; 838 $content = $post->post_content;839 843 $content = str_replace("\n<!--nextpage-->\n", '<!--nextpage-->', $content); 840 844 $content = str_replace("\n<!--nextpage-->", '<!--nextpage-->', $content); … … 1241 1245 1242 1246 function the_post() { 1243 start_wp(true); 1247 global $wp_query; 1248 $wp_query->the_post(); 1244 1249 } 1245 1250 trunk/wp-includes/template-functions-general.php
r2071 r2104 608 608 function get_the_time( $d = '' ) { 609 609 if ( '' == $d ) 610 $the_time = date( get_settings('time_format'), get_post_time());610 $the_time = get_post_time(get_settings('time_format')); 611 611 else 612 $the_time = date( $d, get_post_time());612 $the_time = get_post_time($d); 613 613 return apply_filters('get_the_time', $the_time); 614 614 } 615 615 616 function get_post_time( $ gmt = false ) { // returns timestamp616 function get_post_time( $d = 'U', $gmt = false ) { // returns timestamp 617 617 global $post; 618 618 if ( $gmt ) 619 $time = mysql2date('U', $post->post_date_gmt);619 $time = $post->post_date_gmt; 620 620 else 621 $time = mysql2date('U', $post->post_date); 621 $time = $post->post_date; 622 623 $time = mysql2date($d, $time); 622 624 return apply_filters('get_the_time', $time); 623 625 }
