Changeset 21735 for trunk/wp-admin/includes/post.php
- Timestamp:
- 09/04/2012 04:29:28 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/post.php
r21651 r21735 1122 1122 * 1123 1123 * @param int $thumbnail_id ID of the attachment used for thumbnail 1124 * @param int $post_id ID of the post associated with the thumbnail, defaults to global $post_ID1124 * @param mixed $post The post ID or object associated with the thumbnail, defaults to global $post. 1125 1125 * @return string html 1126 1126 */ 1127 function _wp_post_thumbnail_html( $thumbnail_id = null, $post_id = null ) { 1128 global $content_width, $_wp_additional_image_sizes, $post_ID; 1129 1130 if ( empty( $post_id ) ) 1131 $post_id = $post_ID; 1132 1133 $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post_id) ); 1127 function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { 1128 global $content_width, $_wp_additional_image_sizes; 1129 1130 $post = get_post( $post ); 1131 1132 $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) ); 1134 1133 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="' . esc_attr__( 'Set featured image' ) . '" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1135 1134 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); … … 1143 1142 $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' ); 1144 1143 if ( !empty( $thumbnail_html ) ) { 1145 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$post_id");1144 $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); 1146 1145 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html ); 1147 1146 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html__( 'Remove featured image' ) . '</a></p>'; … … 1150 1149 } 1151 1150 1152 return apply_filters( 'admin_post_thumbnail_html', $content, $post _id);1151 return apply_filters( 'admin_post_thumbnail_html', $content, $post->ID ); 1153 1152 } 1154 1153 … … 1208 1207 */ 1209 1208 function _admin_notice_post_locked() { 1210 global $post; 1211 1209 $post = get_post(); 1212 1210 $lock = explode( ':', get_post_meta( $post->ID, '_edit_lock', true ) ); 1213 1211 $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
Note: See TracChangeset
for help on using the changeset viewer.