Changeset 21597
- Timestamp:
- 08/23/2012 08:01:10 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit.php
r21322 r21597 104 104 $deleted = 0; 105 105 foreach( (array) $post_ids as $post_id ) { 106 $post_del = &get_post($post_id);106 $post_del = get_post($post_id); 107 107 108 108 if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) -
trunk/wp-admin/includes/ajax-actions.php
r21504 r21597 513 513 wp_die( -1 ); 514 514 515 if ( ! get_page( $id ) )515 if ( ! get_post( $id ) ) 516 516 wp_die( 1 ); 517 517 -
trunk/wp-admin/includes/class-wp-posts-list-table.php
r21504 r21597 510 510 $find_main_page = (int) $post->post_parent; 511 511 while ( $find_main_page > 0 ) { 512 $parent = get_p age( $find_main_page );512 $parent = get_post( $find_main_page ); 513 513 514 514 if ( is_null( $parent ) ) -
trunk/wp-admin/includes/media.php
r21504 r21597 894 894 */ 895 895 function image_media_send_to_editor($html, $attachment_id, $attachment) { 896 $post = &get_post($attachment_id);896 $post = get_post($attachment_id); 897 897 if ( substr($post->post_mime_type, 0, 5) == 'image' ) { 898 898 $url = $attachment['url']; … … 921 921 function get_attachment_fields_to_edit($post, $errors = null) { 922 922 if ( is_int($post) ) 923 $post = &get_post($post);923 $post = get_post($post); 924 924 if ( is_array($post) ) 925 $post = (object) $post;925 $post = new WP_Post( (object) $post ); 926 926 927 927 $image_url = wp_get_attachment_url($post->ID); -
trunk/wp-admin/includes/post.php
r21300 r21597 161 161 // Autosave shouldn't save too soon after a real save 162 162 if ( 'autosave' == $post_data['action'] ) { 163 $post = &get_post( $post_ID );163 $post = get_post( $post_ID ); 164 164 $now = time(); 165 165 $then = strtotime($post->post_date_gmt . ' +0000'); … … 440 440 $post->post_parent = 0; 441 441 $post->menu_order = 0; 442 $post = new WP_Post( $post ); 442 443 } 443 444 … … 746 747 */ 747 748 function _fix_attachment_links( $post_ID ) { 748 $post = &get_post( $post_ID, ARRAY_A );749 $post = get_post( $post_ID, ARRAY_A ); 749 750 $content = $post['post_content']; 750 751 … … 1013 1014 */ 1014 1015 function get_sample_permalink($id, $title = null, $name = null) { 1015 $post = &get_post($id);1016 $post = get_post($id); 1016 1017 if ( !$post->ID ) 1017 1018 return array('', ''); … … 1079 1080 function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) { 1080 1081 global $wpdb; 1081 $post = &get_post($id);1082 $post = get_post($id); 1082 1083 1083 1084 list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug); -
trunk/wp-admin/includes/template.php
r21538 r21597 706 706 function the_attachment_links( $id = false ) { 707 707 $id = (int) $id; 708 $post = &get_post( $id );708 $post = get_post( $id ); 709 709 710 710 if ( $post->post_type != 'attachment' ) -
trunk/wp-admin/post.php
r21504 r21597 203 203 check_admin_referer('trash-post_' . $post_id); 204 204 205 $post = &get_post($post_id);205 $post = get_post($post_id); 206 206 207 207 if ( !current_user_can($post_type_object->cap->delete_post, $post_id) ) -
trunk/wp-admin/upload.php
r20449 r21597 58 58 return; 59 59 60 $parent = &get_post( $parent_id );60 $parent = get_post( $parent_id ); 61 61 if ( !current_user_can( 'edit_post', $parent_id ) ) 62 62 wp_die( __( 'You are not allowed to edit this post.' ) ); -
trunk/wp-includes/class-wp-xmlrpc-server.php
r21526 r21597 776 776 $parent_title = ""; 777 777 if ( ! empty( $page->post_parent ) ) { 778 $parent = get_p age( $page->post_parent );778 $parent = get_post( $page->post_parent ); 779 779 $parent_title = $parent->post_title; 780 780 } … … 1944 1944 } 1945 1945 1946 $page = get_p age($page_id);1946 $page = get_post($page_id); 1947 1947 if ( ! $page ) 1948 1948 return new IXR_Error( 404, __( 'Invalid post ID.' ) ); -
trunk/wp-includes/comment.php
r21570 r21597 1372 1372 wp_notify_moderator($comment_ID); 1373 1373 1374 $post = &get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment1374 $post = get_post($commentdata['comment_post_ID']); // Don't notify if it's your own comment 1375 1375 1376 1376 if ( get_option('comments_notify') && $commentdata['comment_approved'] && ( ! isset( $commentdata['user_id'] ) || $post->post_author != $commentdata['user_id'] ) ) -
trunk/wp-includes/deprecated.php
r21568 r21597 27 27 _deprecated_function( __FUNCTION__, '1.5.1', 'get_post()' ); 28 28 29 $post = &get_post($postid);29 $post = get_post($postid); 30 30 31 31 $postdata = array ( … … 1893 1893 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_link()' ); 1894 1894 $id = (int) $id; 1895 $_post = &get_post($id);1895 $_post = get_post($id); 1896 1896 1897 1897 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) ) … … 1922 1922 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image_src()' ); 1923 1923 $id = (int) $id; 1924 if ( !$post = &get_post($id) )1924 if ( !$post = get_post($id) ) 1925 1925 return false; 1926 1926 … … 1967 1967 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 1968 1968 $id = (int) $id; 1969 if ( !$post = &get_post($id) )1969 if ( !$post = get_post($id) ) 1970 1970 return false; 1971 1971 … … 2024 2024 _deprecated_function( __FUNCTION__, '2.5', 'wp_get_attachment_image()' ); 2025 2025 $id = (int) $id; 2026 if ( !$post = &get_post($id) )2026 if ( !$post = get_post($id) ) 2027 2027 return false; 2028 2028 … … 2802 2802 2803 2803 if ( ! empty( $GLOBALS['post'] ) && ! empty( $GLOBALS['post']->post_parent ) ) 2804 $post = &get_post($GLOBALS['post']->post_parent);2804 $post = get_post($GLOBALS['post']->post_parent); 2805 2805 2806 2806 if ( empty($post) ) -
trunk/wp-includes/general-template.php
r21592 r21597 1628 1628 if ( is_single() || is_page() ) { 1629 1629 $id = 0; 1630 $post = &get_post( $id );1630 $post = get_post( $id ); 1631 1631 1632 1632 if ( comments_open() || pings_open() || $post->comment_count > 0 ) { -
trunk/wp-includes/link-template.php
r21596 r21597 97 97 $sample = true; 98 98 } else { 99 $post = &get_post($id);99 $post = get_post($id); 100 100 $sample = false; 101 101 } … … 179 179 global $wp_rewrite; 180 180 181 $post = &get_post($id);181 $post = get_post($id); 182 182 183 183 if ( is_wp_error( $post ) ) … … 896 896 */ 897 897 function get_edit_post_link( $id = 0, $context = 'display' ) { 898 if ( !$post = &get_post( $id ) )898 if ( !$post = get_post( $id ) ) 899 899 return; 900 900 … … 925 925 */ 926 926 function edit_post_link( $link = null, $before = '', $after = '', $id = 0 ) { 927 if ( !$post = &get_post( $id ) )927 if ( !$post = get_post( $id ) ) 928 928 return; 929 929 … … 955 955 _deprecated_argument( __FUNCTION__, '3.0' ); 956 956 957 if ( !$post = &get_post( $id ) )957 if ( !$post = get_post( $id ) ) 958 958 return; 959 959 … … 1202 1202 function get_adjacent_post_rel_link($title = '%title', $in_same_cat = false, $excluded_categories = '', $previous = true) { 1203 1203 if ( $previous && is_attachment() && is_object( $GLOBALS['post'] ) ) 1204 $post = &get_post($GLOBALS['post']->post_parent);1204 $post = get_post($GLOBALS['post']->post_parent); 1205 1205 else 1206 1206 $post = get_adjacent_post($in_same_cat,$excluded_categories,$previous); … … 1367 1367 function adjacent_post_link($format, $link, $in_same_cat = false, $excluded_categories = '', $previous = true) { 1368 1368 if ( $previous && is_attachment() ) 1369 $post = &get_post($GLOBALS['post']->post_parent);1369 $post = get_post($GLOBALS['post']->post_parent); 1370 1370 else 1371 1371 $post = get_adjacent_post($in_same_cat, $excluded_categories, $previous); -
trunk/wp-includes/media.php
r21351 r21597 656 656 if ( is_array($size) ) 657 657 $size = join('x', $size); 658 $attachment = &get_post($attachment_id);658 $attachment = get_post($attachment_id); 659 659 $default_attr = array( 660 660 'src' => $src, -
trunk/wp-includes/post-template.php
r21559 r21597 102 102 */ 103 103 function get_the_title( $id = 0 ) { 104 $post = &get_post($id);104 $post = get_post($id); 105 105 106 106 $title = isset($post->post_title) ? $post->post_title : ''; … … 149 149 */ 150 150 function get_the_guid( $id = 0 ) { 151 $post = &get_post($id);151 $post = get_post($id); 152 152 153 153 return apply_filters('get_the_guid', $post->guid); … … 277 277 */ 278 278 function has_excerpt( $id = 0 ) { 279 $post = &get_post( $id );279 $post = get_post( $id ); 280 280 return ( !empty( $post->post_excerpt ) ); 281 281 } … … 475 475 $page_id = $wp_query->get_queried_object_id(); 476 476 477 $post = get_p age($page_id);477 $post = get_post($page_id); 478 478 479 479 $classes[] = 'page-id-' . $page_id; … … 1016 1016 $css_class = array('page_item', 'page-item-'.$page->ID); 1017 1017 if ( !empty($current_page) ) { 1018 $_current_page = get_p age( $current_page );1018 $_current_page = get_post( $current_page ); 1019 1019 if ( in_array( $page->ID, $_current_page->ancestors ) ) 1020 1020 $css_class[] = 'current_page_ancestor'; … … 1139 1139 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) { 1140 1140 $id = intval( $id ); 1141 $_post = &get_post( $id );1141 $_post = get_post( $id ); 1142 1142 1143 1143 if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) -
trunk/wp-includes/post.php
r21572 r21597 587 587 */ 588 588 function get_post_mime_type($ID = '') { 589 $post = &get_post($ID);589 $post = get_post($ID); 590 590 591 591 if ( is_object($post) ) … … 3349 3349 3350 3350 if ( $foundid ) 3351 return get_p age( $foundid, $output );3351 return get_post( $foundid, $output ); 3352 3352 3353 3353 return null; … … 3369 3369 $page = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_title = %s AND post_type= %s", $page_title, $post_type ) ); 3370 3370 if ( $page ) 3371 return get_p age($page, $output);3371 return get_post( $page, $output ); 3372 3372 3373 3373 return null; … … 3456 3456 function get_page_uri($page) { 3457 3457 if ( ! is_object($page) ) 3458 $page = get_p age($page);3458 $page = get_post( $page ); 3459 3459 $uri = $page->post_name; 3460 3460 3461 3461 foreach ( $page->ancestors as $parent ) { 3462 $uri = get_p age($parent)->post_name . "/" . $uri;3462 $uri = get_post( $parent )->post_name . "/" . $uri; 3463 3463 } 3464 3464 … … 3717 3717 return true; 3718 3718 if ( $id = url_to_postid($url) ) { 3719 $post = &get_post($id);3719 $post = get_post($id); 3720 3720 if ( 'attachment' == $post->post_type ) 3721 3721 return true; … … 4013 4013 function wp_get_attachment_metadata( $post_id = 0, $unfiltered = false ) { 4014 4014 $post_id = (int) $post_id; 4015 if ( !$post = &get_post( $post_id ) )4015 if ( !$post = get_post( $post_id ) ) 4016 4016 return false; 4017 4017 … … 4035 4035 function wp_update_attachment_metadata( $post_id, $data ) { 4036 4036 $post_id = (int) $post_id; 4037 if ( !$post = &get_post( $post_id ) )4037 if ( !$post = get_post( $post_id ) ) 4038 4038 return false; 4039 4039 … … 4053 4053 function wp_get_attachment_url( $post_id = 0 ) { 4054 4054 $post_id = (int) $post_id; 4055 if ( !$post = &get_post( $post_id ) )4055 if ( !$post = get_post( $post_id ) ) 4056 4056 return false; 4057 4057 … … 4092 4092 function wp_get_attachment_thumb_file( $post_id = 0 ) { 4093 4093 $post_id = (int) $post_id; 4094 if ( !$post = &get_post( $post_id ) )4094 if ( !$post = get_post( $post_id ) ) 4095 4095 return false; 4096 4096 if ( !is_array( $imagedata = wp_get_attachment_metadata( $post->ID ) ) ) … … 4114 4114 function wp_get_attachment_thumb_url( $post_id = 0 ) { 4115 4115 $post_id = (int) $post_id; 4116 if ( !$post = &get_post( $post_id ) )4116 if ( !$post = get_post( $post_id ) ) 4117 4117 return false; 4118 4118 if ( !$url = wp_get_attachment_url( $post->ID ) ) … … 4141 4141 function wp_attachment_is_image( $post_id = 0 ) { 4142 4142 $post_id = (int) $post_id; 4143 if ( !$post = &get_post( $post_id ) )4143 if ( !$post = get_post( $post_id ) ) 4144 4144 return false; 4145 4145 … … 4172 4172 if ( is_numeric($mime) ) { 4173 4173 $mime = (int) $mime; 4174 if ( $post = &get_post( $mime ) ) {4174 if ( $post = get_post( $mime ) ) { 4175 4175 $post_id = (int) $post->ID; 4176 4176 $ext = preg_replace('/^.+?\.([^.]+)$/', '$1', $post->guid); -
trunk/wp-includes/query.php
r21585 r21597 2129 2129 $q['name'] = $q['pagename']; 2130 2130 $where .= " AND ($wpdb->posts.ID = '$reqpage')"; 2131 $reqpage_obj = get_p age($reqpage);2131 $reqpage_obj = get_post( $reqpage ); 2132 2132 if ( is_object($reqpage_obj) && 'attachment' == $reqpage_obj->post_type ) { 2133 2133 $this->is_attachment = true; … … 2976 2976 } elseif ( $this->is_posts_page ) { 2977 2977 $page_for_posts = get_option('page_for_posts'); 2978 $this->queried_object = get_p age( $page_for_posts );2978 $this->queried_object = get_post( $page_for_posts ); 2979 2979 $this->queried_object_id = (int) $this->queried_object->ID; 2980 2980 } elseif ( $this->is_singular && !is_null($this->post) ) { -
trunk/wp-includes/taxonomy.php
r21559 r21597 3074 3074 */ 3075 3075 function get_the_taxonomies($post = 0, $args = array() ) { 3076 if ( is_int($post) ) 3077 $post =& get_post($post); 3078 elseif ( !is_object($post) ) 3079 $post =& $GLOBALS['post']; 3076 $post = get_post( $post ); 3080 3077 3081 3078 $args = wp_parse_args( $args, array( … … 3123 3120 */ 3124 3121 function get_post_taxonomies($post = 0) { 3125 $post = & get_post($post);3122 $post = get_post( $post ); 3126 3123 3127 3124 return get_object_taxonomies($post);
Note: See TracChangeset
for help on using the changeset viewer.