Changeset 32673 for trunk/src/wp-admin/includes/media.php
- Timestamp:
- 05/31/2015 04:53:12 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/media.php
r32672 r32673 1494 1494 if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) ) 1495 1495 && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) { 1496 1497 $calling_post = get_post( $calling_post_id ); 1498 $calling_post_type_object = get_post_type_object( $calling_post->post_type ); 1499 1496 1500 $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" ); 1497 $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>";1501 $thumbnail = "<a class='wp-post-thumbnail' id='wp-post-thumbnail-" . $attachment_id . "' href='#' onclick='WPSetAsThumbnail(\"$attachment_id\", \"$ajax_nonce\");return false;'>" . esc_html( $calling_post_type_object->labels->use_featured_image ) . "</a>"; 1498 1502 } 1499 1503 … … 1737 1741 */ 1738 1742 function media_upload_header() { 1743 1739 1744 $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0; 1740 echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n"; 1745 1746 if ( ! empty( $post_id ) ) { 1747 $post_type = get_post_type( $post_id ); 1748 } else { 1749 $post_type = ''; 1750 } 1751 1752 echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>'; 1741 1753 if ( empty( $_GET['chromeless'] ) ) { 1742 1754 echo '<div id="media-upload-header">';
Note: See TracChangeset
for help on using the changeset viewer.