Changeset 32673
- Timestamp:
- 05/31/2015 04:53:12 PM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/edit-form-advanced.php
r32642 r32673 214 214 215 215 if ( $thumbnail_support && current_user_can( 'upload_files' ) ) 216 add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');216 add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low'); 217 217 218 218 if ( post_type_supports($post_type, 'excerpt') ) … … 372 372 373 373 if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) { 374 $publish_box .= '<li>' . __('<strong>Featured Image</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the featured image as a post thumbnail on the home page, a custom header, etc.') . '</li>'; 374 /* translators: %s: Featured Image */ 375 $publish_box .= '<li>' . sprintf( __( '<strong>%s</strong> - This allows you to associate an image with your post without inserting it. This is usually useful only if your theme makes use of the image as a post thumbnail on the home page, a custom header, etc.' ), esc_html( $post_type_object->labels->featured_image ) ) . '</li>'; 375 376 } 376 377 -
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">'; -
trunk/src/wp-admin/includes/post.php
r32643 r32673 1363 1363 global $content_width, $_wp_additional_image_sizes; 1364 1364 1365 $post = get_post( $post ); 1366 1367 $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) ); 1368 $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>'; 1369 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) ); 1365 $post = get_post( $post ); 1366 $post_type_object = get_post_type_object( $post->post_type ); 1367 $set_thumbnail_link = '<p class="hide-if-no-js"><a title="%s" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>'; 1368 $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID ); 1369 1370 $content = sprintf( $set_thumbnail_link, 1371 esc_attr( $post_type_object->labels->set_featured_image ), 1372 esc_url( $upload_iframe_src ), 1373 esc_html( $post_type_object->labels->set_featured_image ) 1374 ); 1370 1375 1371 1376 if ( $thumbnail_id && get_post( $thumbnail_id ) ) { … … 1378 1383 if ( !empty( $thumbnail_html ) ) { 1379 1384 $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); 1380 $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html ); 1381 $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>'; 1385 $content = sprintf( $set_thumbnail_link, 1386 esc_attr( $post_type_object->labels->set_featured_image ), 1387 esc_url( $upload_iframe_src ), 1388 $thumbnail_html 1389 ); 1390 $content .= '<p class="hide-if-no-js"><a href="#" id="remove-post-thumbnail" onclick="WPRemoveThumbnail(\'' . $ajax_nonce . '\');return false;">' . esc_html( $post_type_object->labels->remove_featured_image ) . '</a></p>'; 1382 1391 } 1383 1392 $content_width = $old_content_width; -
trunk/src/wp-admin/js/set-post-thumbnail.js
r26199 r32673 10 10 }, function(str){ 11 11 var win = window.dialogArguments || opener || parent || top; 12 $link.text( setPostThumbnailL10n.setThumbnail ); 12 setThumbnail = 'setThumbnail_' + post_type; 13 $link.text( setPostThumbnailL10n[ setThumbnail ] ); 13 14 if ( str == '0' ) { 14 15 alert( setPostThumbnailL10n.error ); -
trunk/src/wp-includes/media.php
r32609 r32673 2314 2314 2315 2315 wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/embed/([^/]+)#i', 'wp_embed_handler_youtube' ); 2316 wp_embed_register_handler( 'youtube_v_url', '#https?://(www.)?youtube\.com/v/([^/]+)#i', 'wp_embed_handler_youtube' ); 2316 2317 2317 2318 wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' ); … … 3009 3010 $hier = $post && is_post_type_hierarchical( $post->post_type ); 3010 3011 3012 $post_type_object = get_post_type_object( $post->post_type ); 3013 3011 3014 $strings = array( 3012 3015 // Generic … … 3067 3070 3068 3071 // Featured Images 3069 'setFeaturedImageTitle' => __( 'Set Featured Image' ),3070 'setFeaturedImage' => __( 'Set featured image' ),3072 'setFeaturedImageTitle' => $post_type_object->labels->featured_image, 3073 'setFeaturedImage' => $post_type_object->labels->set_featured_image, 3071 3074 3072 3075 // Gallery -
trunk/src/wp-includes/post.php
r32647 r32673 1625 1625 * ones the default is 'Parent Page:'. 1626 1626 * - all_items - String for the submenu. Default is All Posts/All Pages. 1627 * - featured_image - Default is Featured Image. 1628 * - set_featured_image - Default is Set featured image. 1629 * - remove_featured_image - Default is Remove featured image. 1630 * - use_featured_image - Default is Use as featured image. 1627 1631 * - menu_name - Default is the same as `name`. 1628 1632 * … … 1631 1635 * 1632 1636 * @since 3.0.0 1637 * @since 4.3.0 Added the `featured_image`, `set_featured_image`, `remove_featured_image`, and `use_featured_image` labels. 1633 1638 * @access private 1634 1639 * … … 1649 1654 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ), 1650 1655 'parent_item_colon' => array( null, __('Parent Page:') ), 1651 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ) 1656 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ), 1657 'featured_image' => array( __( 'Featured Image' ), __( 'Featured Image' ) ), 1658 'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ), 1659 'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ), 1660 'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ), 1652 1661 ); 1653 1662 $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name']; -
trunk/src/wp-includes/script-loader.php
r32623 r32673 571 571 )); 572 572 573 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 574 did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array( 575 'setThumbnail' => __( 'Use as featured image' ), 573 $setPostThumbnailL10n = array( 574 'setThumbnail' => __( 'Use as featured image' ), // Back compat 576 575 'saving' => __( 'Saving...' ), 577 576 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ), 578 577 'done' => __( 'Done' ) 579 ) ); 578 ); 579 580 foreach ( get_post_types( null, 'objects' ) as $post_type_object ) { 581 if ( isset( $post_type_object->labels->use_featured_image ) ) { 582 $setPostThumbnailL10n[ "setThumbnail_{$post_type_object->name}" ] = $post_type_object->labels->use_featured_image; 583 } 584 } 585 $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 ); 586 did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n ); 580 587 581 588 // Navigation Menus
Note: See TracChangeset
for help on using the changeset viewer.