Changeset 14730 for trunk/wp-admin/includes/media.php
- Timestamp:
- 05/18/2010 10:08:49 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r14693 r14730 1287 1287 $calling_post_id = 0; 1288 1288 if ( isset( $_GET['post_id'] ) ) 1289 $calling_post_id = $_GET['post_id'];1289 $calling_post_id = absint( $_GET['post_id'] ); 1290 1290 elseif ( isset( $_POST ) && count( $_POST ) ) // Like for async-upload where $_GET['post_id'] isn't set 1291 1291 $calling_post_id = $post->post_parent; 1292 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) 1293 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>"; 1292 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { 1293 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); 1294 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html__( "Use as featured image" ) . "</a>"; 1295 } 1294 1296 1295 1297 if ( ( $send || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) )
Note: See TracChangeset
for help on using the changeset viewer.