Changeset 21735 for trunk/wp-admin/includes/template.php
- Timestamp:
- 09/04/2012 04:29:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/template.php
r21659 r21735 167 167 */ 168 168 function wp_popular_terms_checklist( $taxonomy, $default = 0, $number = 10, $echo = true ) { 169 global $post_ID; 170 171 if ( $post_ID ) 172 $checked_terms = wp_get_object_terms($post_ID, $taxonomy, array('fields'=>'ids')); 169 $post = get_post(); 170 if ( $post->ID ) 171 $checked_terms = wp_get_object_terms($post->ID, $taxonomy, array('fields'=>'ids')); 173 172 else 174 173 $checked_terms = array(); … … 576 575 */ 577 576 function touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 ) { 578 global $wp_locale, $post, $comment; 577 global $wp_locale, $comment; 578 $post = get_post(); 579 579 580 580 if ( $for_post ) … … 671 671 */ 672 672 function parent_dropdown( $default = 0, $parent = 0, $level = 0 ) { 673 global $wpdb, $post_ID; 673 global $wpdb; 674 $post = get_post(); 674 675 $items = $wpdb->get_results( $wpdb->prepare("SELECT ID, post_parent, post_title FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'page' ORDER BY menu_order", $parent) ); 675 676 … … 677 678 foreach ( $items as $item ) { 678 679 // A page cannot be its own parent. 679 if (!empty ( $post_ID ) ) { 680 if ( $item->ID == $post_ID ) { 681 continue; 682 } 683 } 680 if ( $post->ID && $item->ID == $post->ID ) 681 continue; 682 684 683 $pad = str_repeat( ' ', $level * 3 ); 685 684 if ( $item->ID == $default) … … 1346 1345 */ 1347 1346 function the_post_password() { 1348 global $post; 1349 if ( isset( $post->post_password ) ) echo esc_attr( $post->post_password ); 1347 $post = get_post(); 1348 if ( isset( $post->post_password ) ) 1349 echo esc_attr( $post->post_password ); 1350 1350 } 1351 1351 … … 1357 1357 * 1358 1358 * @since 2.7.0 1359 * @param int $post_id The post id. If not supplied the global $post is used.1359 * @param mixed $post Post id or object. If not supplied the global $post is used. 1360 1360 * @return string The post title if set 1361 1361 */ 1362 function _draft_or_post_title( $post _id= 0 ) {1363 $title = get_the_title( $post_id);1364 if ( empty( $title) )1365 $title = __( '(no title)');1362 function _draft_or_post_title( $post = 0 ) { 1363 $title = get_the_title( $post ); 1364 if ( empty( $title ) ) 1365 $title = __( '(no title)' ); 1366 1366 return $title; 1367 1367 }
Note: See TracChangeset
for help on using the changeset viewer.