<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[32673] trunk/src: Introduce `featured_image`, `set_featured_image`, `remove_featured_image`, and `use_featured_image` post type labels when registering a post type in order to override the 'Featured Image' text and its related phrases.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="https://core.trac.wordpress.org/changeset/32673">32673</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"https://core.trac.wordpress.org/changeset/32673","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>johnbillion</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-31 16:53:12 +0000 (Sun, 31 May 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Introduce `featured_image`, `set_featured_image`, `remove_featured_image`, and `use_featured_image` post type labels when registering a post type in order to override the 'Featured Image' text and its related phrases.
Props johnbillion, mordauk, valendesigns.
Fixes <a href="https://core.trac.wordpress.org/ticket/19257">#19257</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcwpadmineditformadvancedphp">trunk/src/wp-admin/edit-form-advanced.php</a></li>
<li><a href="#trunksrcwpadminincludesmediaphp">trunk/src/wp-admin/includes/media.php</a></li>
<li><a href="#trunksrcwpadminincludespostphp">trunk/src/wp-admin/includes/post.php</a></li>
<li><a href="#trunksrcwpadminjssetpostthumbnailjs">trunk/src/wp-admin/js/set-post-thumbnail.js</a></li>
<li><a href="#trunksrcwpincludesmediaphp">trunk/src/wp-includes/media.php</a></li>
<li><a href="#trunksrcwpincludespostphp">trunk/src/wp-includes/post.php</a></li>
<li><a href="#trunksrcwpincludesscriptloaderphp">trunk/src/wp-includes/script-loader.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcwpadmineditformadvancedphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/edit-form-advanced.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/edit-form-advanced.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-admin/edit-form-advanced.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -213,7 +213,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> add_meta_box('pageparentdiv', 'page' == $post_type ? __('Page Attributes') : __('Attributes'), 'page_attributes_meta_box', null, 'side', 'core');
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $thumbnail_support && current_user_can( 'upload_files' ) )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_meta_box('postimagediv', __('Featured Image'), 'post_thumbnail_meta_box', null, 'side', 'low');
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta_box('postimagediv', esc_html( $post_type_object->labels->featured_image ), 'post_thumbnail_meta_box', null, 'side', 'low');
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( post_type_supports($post_type, 'excerpt') )
</span><span class="cx" style="display: block; padding: 0 10px"> add_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', null, 'normal', 'core');
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -371,7 +371,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( current_theme_supports( 'post-thumbnails' ) && post_type_supports( 'post', 'thumbnail' ) ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /* translators: %s: Featured Image */
+ $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>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $publish_box .= '</ul>';
</span></span></pre></div>
<a id="trunksrcwpadminincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/media.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-admin/includes/media.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1493,8 +1493,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> if ( 'image' == $type && $calling_post_id && current_theme_supports( 'post-thumbnails', get_post_type( $calling_post_id ) )
</span><span class="cx" style="display: block; padding: 0 10px"> && post_type_supports( get_post_type( $calling_post_id ), 'thumbnail' ) && get_post_thumbnail_id( $calling_post_id ) != $attachment_id ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ $calling_post = get_post( $calling_post_id );
+ $calling_post_type_object = get_post_type_object( $calling_post->post_type );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $ajax_nonce = wp_create_nonce( "set_post_thumbnail-$calling_post_id" );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $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>";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $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>";
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( ( $r['send'] || $thumbnail || $delete ) && !isset( $form_fields['buttons'] ) ) {
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1736,8 +1740,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 2.5.0
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function media_upload_header() {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
</ins><span class="cx" style="display: block; padding: 0 10px"> $post_id = isset( $_REQUEST['post_id'] ) ? intval( $_REQUEST['post_id'] ) : 0;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- echo '<script type="text/javascript">post_id = ' . $post_id . ";</script>\n";
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ if ( ! empty( $post_id ) ) {
+ $post_type = get_post_type( $post_id );
+ } else {
+ $post_type = '';
+ }
+
+ echo '<script type="text/javascript">post_id = ' . $post_id . ';post_type = ' . $post_type . ';</script>';
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( empty( $_GET['chromeless'] ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> echo '<div id="media-upload-header">';
</span><span class="cx" style="display: block; padding: 0 10px"> the_media_upload_tabs();
</span></span></pre></div>
<a id="trunksrcwpadminincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/includes/post.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-admin/includes/post.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1362,11 +1362,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $content_width, $_wp_additional_image_sizes;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post = get_post( $post );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post = get_post( $post );
+ $post_type_object = get_post_type_object( $post->post_type );
+ $set_thumbnail_link = '<p class="hide-if-no-js"><a title="%s" href="%s" id="set-post-thumbnail" class="thickbox">%s</a></p>';
+ $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $upload_iframe_src = esc_url( get_upload_iframe_src('image', $post->ID ) );
- $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>';
- $content = sprintf( $set_thumbnail_link, $upload_iframe_src, esc_html__( 'Set featured image' ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = sprintf( $set_thumbnail_link,
+ esc_attr( $post_type_object->labels->set_featured_image ),
+ esc_url( $upload_iframe_src ),
+ esc_html( $post_type_object->labels->set_featured_image )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> if ( $thumbnail_id && get_post( $thumbnail_id ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $old_content_width = $content_width;
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1377,8 +1382,12 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $thumbnail_html = wp_get_attachment_image( $thumbnail_id, 'post-thumbnail' );
</span><span class="cx" style="display: block; padding: 0 10px"> if ( !empty( $thumbnail_html ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $content = sprintf( $set_thumbnail_link, $upload_iframe_src, $thumbnail_html );
- $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>';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $content = sprintf( $set_thumbnail_link,
+ esc_attr( $post_type_object->labels->set_featured_image ),
+ esc_url( $upload_iframe_src ),
+ $thumbnail_html
+ );
+ $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>';
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> $content_width = $old_content_width;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span></span></pre></div>
<a id="trunksrcwpadminjssetpostthumbnailjs"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-admin/js/set-post-thumbnail.js</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-admin/js/set-post-thumbnail.js 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-admin/js/set-post-thumbnail.js 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -9,7 +9,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> action: 'set-post-thumbnail', post_id: post_id, thumbnail_id: id, _ajax_nonce: nonce, cookie: encodeURIComponent( document.cookie )
</span><span class="cx" style="display: block; padding: 0 10px"> }, function(str){
</span><span class="cx" style="display: block; padding: 0 10px"> var win = window.dialogArguments || opener || parent || top;
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $link.text( setPostThumbnailL10n.setThumbnail );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ setThumbnail = 'setThumbnail_' + post_type;
+ $link.text( setPostThumbnailL10n[ setThumbnail ] );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( str == '0' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> alert( setPostThumbnailL10n.error );
</span><span class="cx" style="display: block; padding: 0 10px"> } else {
</span></span></pre></div>
<a id="trunksrcwpincludesmediaphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/media.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/media.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-includes/media.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2313,6 +2313,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_embed_register_handler( 'youtube_embed_url', '#https?://(www.)?youtube\.com/embed/([^/]+)#i', 'wp_embed_handler_youtube' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ wp_embed_register_handler( 'youtube_v_url', '#https?://(www.)?youtube\.com/v/([^/]+)#i', 'wp_embed_handler_youtube' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> wp_embed_register_handler( 'googlevideo', '#http://video\.google\.([A-Za-z.]{2,5})/videoplay\?docid=([\d-]+)(.*?)#i', 'wp_embed_handler_googlevideo' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3008,6 +3009,8 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $hier = $post && is_post_type_hierarchical( $post->post_type );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $post_type_object = get_post_type_object( $post->post_type );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $strings = array(
</span><span class="cx" style="display: block; padding: 0 10px"> // Generic
</span><span class="cx" style="display: block; padding: 0 10px"> 'url' => __( 'URL' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -3066,8 +3069,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'insertFromUrlTitle' => __( 'Insert from URL' ),
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Featured Images
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'setFeaturedImageTitle' => __( 'Set Featured Image' ),
- 'setFeaturedImage' => __( 'Set featured image' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'setFeaturedImageTitle' => $post_type_object->labels->featured_image,
+ 'setFeaturedImage' => $post_type_object->labels->set_featured_image,
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Gallery
</span><span class="cx" style="display: block; padding: 0 10px"> 'createGalleryTitle' => __( 'Create Gallery' ),
</span></span></pre></div>
<a id="trunksrcwpincludespostphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/post.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/post.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-includes/post.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1624,12 +1624,17 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * - parent_item_colon - This string isn't used on non-hierarchical types. In hierarchical
</span><span class="cx" style="display: block; padding: 0 10px"> * ones the default is 'Parent Page:'.
</span><span class="cx" style="display: block; padding: 0 10px"> * - all_items - String for the submenu. Default is All Posts/All Pages.
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * - featured_image - Default is Featured Image.
+ * - set_featured_image - Default is Set featured image.
+ * - remove_featured_image - Default is Remove featured image.
+ * - use_featured_image - Default is Use as featured image.
</ins><span class="cx" style="display: block; padding: 0 10px"> * - menu_name - Default is the same as `name`.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * Above, the first default value is for non-hierarchical post types (like posts)
</span><span class="cx" style="display: block; padding: 0 10px"> * and the second one is for hierarchical post types (like pages).
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 3.0.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 4.3.0 Added the `featured_image`, `set_featured_image`, `remove_featured_image`, and `use_featured_image` labels.
</ins><span class="cx" style="display: block; padding: 0 10px"> * @access private
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param object $post_type_object Post type object.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1648,7 +1653,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'not_found' => array( __('No posts found.'), __('No pages found.') ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'not_found_in_trash' => array( __('No posts found in Trash.'), __('No pages found in Trash.') ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'parent_item_colon' => array( null, __('Parent Page:') ),
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'all_items' => array( __( 'All Posts' ), __( 'All Pages' ) ),
+ 'featured_image' => array( __( 'Featured Image' ), __( 'Featured Image' ) ),
+ 'set_featured_image' => array( __( 'Set featured image' ), __( 'Set featured image' ) ),
+ 'remove_featured_image' => array( __( 'Remove featured image' ), __( 'Remove featured image' ) ),
+ 'use_featured_image' => array( __( 'Use as featured image' ), __( 'Use as featured image' ) ),
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><span class="cx" style="display: block; padding: 0 10px"> $nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcwpincludesscriptloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/wp-includes/script-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/wp-includes/script-loader.php 2015-05-31 03:17:50 UTC (rev 32672)
+++ trunk/src/wp-includes/script-loader.php 2015-05-31 16:53:12 UTC (rev 32673)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -570,14 +570,21 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'error' => __( 'Could not load the preview image. Please reload the page and try again.' )
</span><span class="cx" style="display: block; padding: 0 10px"> ));
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
- did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', array(
- 'setThumbnail' => __( 'Use as featured image' ),
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $setPostThumbnailL10n = array(
+ 'setThumbnail' => __( 'Use as featured image' ), // Back compat
</ins><span class="cx" style="display: block; padding: 0 10px"> 'saving' => __( 'Saving...' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'error' => __( 'Could not set that as the thumbnail image. Try a different attachment.' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'done' => __( 'Done' )
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ) );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ foreach ( get_post_types( null, 'objects' ) as $post_type_object ) {
+ if ( isset( $post_type_object->labels->use_featured_image ) ) {
+ $setPostThumbnailL10n[ "setThumbnail_{$post_type_object->name}" ] = $post_type_object->labels->use_featured_image;
+ }
+ }
+ $scripts->add( 'set-post-thumbnail', "/wp-admin/js/set-post-thumbnail$suffix.js", array( 'jquery' ), false, 1 );
+ did_action( 'init' ) && $scripts->localize( 'set-post-thumbnail', 'setPostThumbnailL10n', $setPostThumbnailL10n );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Navigation Menus
</span><span class="cx" style="display: block; padding: 0 10px"> $scripts->add( 'nav-menu', "/wp-admin/js/nav-menu$suffix.js", array( 'jquery-ui-sortable', 'jquery-ui-draggable', 'jquery-ui-droppable', 'wp-lists', 'postbox' ) );
</span><span class="cx" style="display: block; padding: 0 10px"> did_action( 'init' ) && $scripts->localize( 'nav-menu', 'navMenuL10n', array(
</span></span></pre>
</div>
</div>
</body>
</html>