<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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 #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#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>
<title>[14571] trunk: I18n for custom post type labels.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/14571">14571</a></dd>
<dt>Author</dt> <dd>nbachiyski</dd>
<dt>Date</dt> <dd>2010-05-11 19:52:50 +0000 (Tue, 11 May 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>I18n for custom post type labels. Props demetris, dimadin. Fixes <a href="http://trac.wordpress.org/ticket/12968">#12968</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmineditphp">trunk/wp-admin/edit.php</a></li>
<li><a href="#trunkwpadminexportphp">trunk/wp-admin/export.php</a></li>
<li><a href="#trunkwpadminincludesnavmenuphp">trunk/wp-admin/includes/nav-menu.php</a></li>
<li><a href="#trunkwpadminincludespostphp">trunk/wp-admin/includes/post.php</a></li>
<li><a href="#trunkwpadminincludestemplatephp">trunk/wp-admin/includes/template.php</a></li>
<li><a href="#trunkwpadminjsnavmenudevjs">trunk/wp-admin/js/nav-menu.dev.js</a></li>
<li><a href="#trunkwpadminmenuphp">trunk/wp-admin/menu.php</a></li>
<li><a href="#trunkwpadminnavmenusphp">trunk/wp-admin/nav-menus.php</a></li>
<li><a href="#trunkwpadminpostnewphp">trunk/wp-admin/post-new.php</a></li>
<li><a href="#trunkwpadminpostphp">trunk/wp-admin/post.php</a></li>
<li><a href="#trunkwpincludesnavmenutemplatephp">trunk/wp-includes/nav-menu-template.php</a></li>
<li><a href="#trunkwpincludesnavmenuphp">trunk/wp-includes/nav-menu.php</a></li>
<li><a href="#trunkwpincludespostphp">trunk/wp-includes/post.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/edit.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -137,8 +137,6 @@
</span><span class="cx">          exit;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-$title = sprintf(__('Edit %s'), $post_type_object->label);
-
</del><span class="cx"> wp_enqueue_script('inline-edit-post');
</span><span class="cx">
</span><span class="cx"> $user_posts = false;
</span><span class="lines">@@ -165,7 +163,7 @@
</span><span class="cx">
</span><span class="cx"> <div class="wrap">
</span><span class="cx"> <?php screen_icon(); ?>
</span><del>-<h2><?php echo esc_html( $title ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html_x('Add New', 'post'); ?></a> <?php
</del><ins>+<h2><?php echo esc_html( $post_type_object->labels->edit_item ); ?> <a href="<?php echo $post_new_file ?>" class="button add-new-h2"><?php echo esc_html($post_type_object->labels->add_new); ?></a> <?php
</ins><span class="cx"> if ( isset($_GET['s']) && $_GET['s'] )
</span><span class="cx">         printf( '<span class="subtitle">' . __('Search results for &#8220;%s&#8221;') . '</span>', get_search_query() ); ?>
</span><span class="cx"> </h2>
</span><span class="lines">@@ -262,9 +260,9 @@
</span><span class="cx"> </ul>
</span><span class="cx">
</span><span class="cx"> <p class="search-box">
</span><del>-        <label class="screen-reader-text" for="post-search-input"><?php printf( _x('Search %s', '%s: post type name'), $post_type_object->label ); ?>:</label>
</del><ins>+        <label class="screen-reader-text" for="post-search-input"><?php echo $post_type_object->labels->search_items; ?>:</label>
</ins><span class="cx">         <input type="text" id="post-search-input" name="s" value="<?php the_search_query(); ?>" />
</span><del>-        <input type="submit" value="<?php echo esc_attr( sprintf( _x('Search %s', '%s: post type name'), $post_type_object->label ) ); ?>" class="button" />
</del><ins>+        <input type="submit" value="<?php echo esc_attr( $post_type_object->labels->search_items ); ?>" class="button" />
</ins><span class="cx"> </p>
</span><span class="cx">
</span><span class="cx"> <input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_GET['post_status']) ? esc_attr($_GET['post_status']) : 'all'; ?>" />
</span><span class="lines">@@ -410,9 +408,9 @@
</span><span class="cx"> <div class="clear"></div>
</span><span class="cx"> <p><?php
</span><span class="cx"> if ( isset($_GET['post_status']) && 'trash' == $_GET['post_status'] )
</span><del>-        printf( __( 'No %s found in the Trash.' ), $post_type_object->label );
</del><ins>+        echo $post_type_object->labels->not_found_in_trash;
</ins><span class="cx"> else
</span><del>-        printf( __( 'No %s found.' ), $post_type_object->label );
</del><ins>+        echo $post_type_object->labels->not_found;
</ins><span class="cx"> ?></p>
</span><span class="cx"> <?php } ?>
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminexportphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/export.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/export.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/export.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -112,7 +112,7 @@
</span><span class="cx"> <select name="post_type" id="post_type">
</span><span class="cx">         <option value="all" selected="selected"><?php _e('All Content'); ?></option>
</span><span class="cx">         <?php foreach ( get_post_types( array( 'public' => true, 'can_export' => true ), 'objects' ) as $post_type_obj ) { ?>
</span><del>-                <option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->label; ?></option>
</del><ins>+                <option value="<?php echo $post_type_obj->name; ?>"><?php echo $post_type_obj->labels->name; ?></option>
</ins><span class="cx">         <?php } ?>
</span><span class="cx"> </select>
</span><span class="cx"> </td>
</span></span></pre></div>
<a id="trunkwpadminincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/nav-menu.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/nav-menu.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/includes/nav-menu.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx">                         $original_title = $original_object->post_title;
</span><span class="cx">                 }
</span><span class="cx">                 ?>
</span><del>-                <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo strtolower(esc_attr( $item->append )); ?>">
</del><ins>+                <li id="menu-item-<?php echo $item_id; ?>" class="menu-item menu-item-depth-<?php echo $depth; ?> menu-item-<?php echo esc_attr( $item->object ); ?>">
</ins><span class="cx">                         <dl class="menu-item-bar <?php
</span><span class="cx">                                 if ( isset($_GET['edit-menu-item']) && $item_id == $_GET['edit-menu-item'] )
</span><span class="cx">                                         echo 'menu-item-edit-active';
</span><span class="lines">@@ -69,7 +69,7 @@
</span><span class="cx">                                 <dt class="menu-item-handle">
</span><span class="cx">                                         <span class="item-title"><?php echo esc_html( $item->title ); ?></span>
</span><span class="cx">                                         <span class="item-controls">
</span><del>-                                                <span class="item-type"><?php echo esc_html( $item->append ); ?></span>
</del><ins>+                                                <span class="item-type"><?php echo esc_html( $item->type_label ); ?></span>
</ins><span class="cx">                                                 <span class="item-order">
</span><span class="cx">                                                         <a href="<?php
</span><span class="cx">                                                                 echo wp_nonce_url(
</span><span class="lines">@@ -161,10 +161,8 @@
</span><span class="cx">
</span><span class="cx">                                 <div class="menu-item-actions description-wide submitbox">
</span><span class="cx">                                         <?php if( 'custom' != $item->type ) : ?>
</span><del>-                                                <p class="link-to-original"><?php
-                                                        _e('Original ');
-                                                        echo esc_html( $item->append );
-                                                        echo ":"; ?>
</del><ins>+                                                <p class="link-to-original">
+                                                        <?php _e('Original:'); ?>
</ins><span class="cx">                                                         <a href="<?php echo esc_attr( $item->url ); ?>">
</span><span class="cx">                                                                 <?php echo esc_html($original_title); ?>
</span><span class="cx">                                                         </a>
</span><span class="lines">@@ -184,7 +182,6 @@
</span><span class="cx">                                         <input class="button-primary save-menu-item" name="save_menu_item" type="submit" value="<?php esc_attr_e('Save Menu Item'); ?>" />
</span><span class="cx">                                 </div>
</span><span class="cx">
</span><del>-                                <input class="menu-item-data-append" type="hidden" name="menu-item-append[<?php echo $item_id; ?>]" value="<?php echo $item->append; ?>" />
</del><span class="cx">                                 <input class="menu-item-data-db-id" type="hidden" name="menu-item-db-id[<?php echo $item_id; ?>]" value="<?php echo $item_id; ?>" />
</span><span class="cx">                                 <input class="menu-item-data-object-id" type="hidden" name="menu-item-object-id[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object_id ); ?>" />
</span><span class="cx">                                 <input class="menu-item-data-object" type="hidden" name="menu-item-object[<?php echo $item_id; ?>]" value="<?php echo esc_attr( $item->object ); ?>" />
</span><span class="lines">@@ -374,7 +371,7 @@
</span><span class="cx">                 $post_type = apply_filters( 'nav_menu_meta_box_object', $post_type );
</span><span class="cx">                 if ( $post_type ) {
</span><span class="cx">                         $id = $post_type->name;
</span><del>-                        add_meta_box( "add-{$id}", $post_type->label, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
</del><ins>+                        add_meta_box( "add-{$id}", $post_type->labels->name, 'wp_nav_menu_item_post_type_meta_box', 'nav-menus', 'side', 'default', $post_type );
</ins><span class="cx">                 }
</span><span class="cx">         }
</span><span class="cx"> }
</span><span class="lines">@@ -544,7 +541,7 @@
</span><span class="cx">         ));
</span><span class="cx">
</span><span class="cx">         if ( !$posts )
</span><del>-                $error = '<li id="error">'. sprintf( __( 'No %s exists' ), $post_type['args']->label ) .'</li>';
</del><ins>+                $error = '<li id="error">'. $post_type['args']->labels->not_found .'</li>';
</ins><span class="cx">
</span><span class="cx">         $current_tab = 'all';
</span><span class="cx">         if ( isset( $_REQUEST[$post_type_name . '-tab'] ) && in_array( $_REQUEST[$post_type_name . '-tab'], array('all', 'search') ) ) {
</span><span class="lines">@@ -865,7 +862,6 @@
</span><span class="cx">                                 'menu-item-parent-id' => ( isset( $_item_object_data['menu-item-parent-id'] ) ? $_item_object_data['menu-item-parent-id'] : '' ),
</span><span class="cx">                                 'menu-item-position' => ( isset( $_item_object_data['menu-item-position'] ) ? $_item_object_data['menu-item-position'] : '' ),
</span><span class="cx">                                 'menu-item-type' => ( isset( $_item_object_data['menu-item-type'] ) ? $_item_object_data['menu-item-type'] : '' ),
</span><del>-                                'menu-item-append' => ( isset( $_item_object_data['menu-item-append'] ) ? $_item_object_data['menu-item-append'] : '' ),
</del><span class="cx">                                 'menu-item-title' => ( isset( $_item_object_data['menu-item-title'] ) ? $_item_object_data['menu-item-title'] : '' ),
</span><span class="cx">                                 'menu-item-url' => ( isset( $_item_object_data['menu-item-url'] ) ? $_item_object_data['menu-item-url'] : '' ),
</span><span class="cx">                                 'menu-item-description' => ( isset( $_item_object_data['menu-item-description'] ) ? $_item_object_data['menu-item-description'] : '' ),
</span></span></pre></div>
<a id="trunkwpadminincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/post.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/post.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/includes/post.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -1079,14 +1079,8 @@
</span><span class="cx">         list($permalink, $post_name) = get_sample_permalink($post->ID, $new_title, $new_slug);
</span><span class="cx">
</span><span class="cx">         if ( 'publish' == $post->post_status ) {
</span><del>-                if ( 'post' == $post->post_type ) {
-                        $view_post = __('View Post');
-                } elseif ( 'page' == $post->post_type ) {
-                        $view_post = __('View Page');
-                } else {
-                        $ptype = get_post_type_object($post->post_type);
-                        $view_post = sprintf(__('View %s'), $ptype->singular_label);
-                }
</del><ins>+                $ptype = get_post_type_object($post->post_type);
+                $view_post = $ptype->labels->view_item;
</ins><span class="cx">                 $title = __('Click to edit this part of the permalink');
</span><span class="cx">         } else {
</span><span class="cx">                 $title = __('Temporary permalink. Click to edit this part.');
</span></span></pre></div>
<a id="trunkwpadminincludestemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/template.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/template.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/includes/template.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -13,9 +13,9 @@
</span><span class="cx"> *
</span><span class="cx"> * @since 2.7
</span><span class="cx"> *
</span><del>- * Outputs the HTML for the hidden table rows used in Categories, Link Categories and Tags quick edit.
</del><ins>+ * Outputs the HTML for the hidden table rows used in Categories, Link Caregories and Tags quick edit.
</ins><span class="cx"> *
</span><del>- * @param string $type "edit-tags", "categories" or "edit-link-categories"
</del><ins>+ * @param string $type "edit-tags", "categoried" or "edit-link-categories"
</ins><span class="cx"> * @param string $taxonomy The taxonomy of the row.
</span><span class="cx"> * @return
</span><span class="cx"> */
</span><span class="lines">@@ -1566,7 +1566,7 @@
</span><span class="cx">                 $attributes = 'class="post-title page-title column-title"' . $style;
</span><span class="cx">                 $edit_link = get_edit_post_link( $page->ID );
</span><span class="cx">                 ?>
</span><del>-                <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . __('Parent Page: ') . esc_html($parent_name) : ''; ?></strong>
</del><ins>+                <td <?php echo $attributes ?>><strong><?php if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) { ?><a class="row-title" href="<?php echo $edit_link; ?>" title="<?php echo esc_attr(sprintf(__('Edit &#8220;%s&#8221;'), $title)); ?>"><?php echo $pad; echo $title ?></a><?php } else { echo $pad; echo $title; }; _post_states($page); echo isset($parent_name) ? ' | ' . $post_type_object->labels->parent . ' ' . esc_html($parent_name) : ''; ?></strong>
</ins><span class="cx">                 <?php
</span><span class="cx">                 $actions = array();
</span><span class="cx">                 if ( current_user_can($post_type_object->edit_cap, $page->ID) && $post->post_status != 'trash' ) {
</span><span class="lines">@@ -3328,10 +3328,10 @@
</span><span class="cx">         if ( isset($post_type_object) ) {
</span><span class="cx">                 switch ( $screen->id ) {
</span><span class="cx">                         case $post_type_object->name:
</span><del>-                                $default_action = array('edit.php?post_type=' . $post_type_object->name => array(sprintf(__('Edit %s'), $post_type_object->label), $post_type_object->edit_type_cap));
</del><ins>+                                $default_action = array('edit.php?post_type=' . $post_type_object->name => array($post_type_object->labels->edit_item, $post_type_object->edit_type_cap));
</ins><span class="cx">                                 break;
</span><span class="cx">                         case "edit-{$post_type_object->name}":
</span><del>-                                $default_action = array('post-new.php?post_type=' . $post_type_object->name => array(sprintf(__('New %s'), $post_type_object->singular_label), $post_type_object->edit_type_cap));
</del><ins>+                                $default_action = array('post-new.php?post_type=' . $post_type_object->name => array($post_type_object->labels->new_item, $post_type_object->edit_type_cap));
</ins><span class="cx">                                 break;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -3746,7 +3746,7 @@
</span><span class="cx">                         if ( isset($_GET['post_type']) && in_array( $_GET['post_type'], get_post_types( array('public' => true ) ) ) )
</span><span class="cx">                                 $post_type = $_GET['post_type'];
</span><span class="cx">                         $post_type_object = get_post_type_object($post_type);
</span><del>-                        $per_page_label = $post_type_object->label;
</del><ins>+                        $per_page_label = $post_type_object->labels->name;
</ins><span class="cx">                         break;
</span><span class="cx">                 case 'ms-sites':
</span><span class="cx">                         $per_page_label = __('Sites');
</span></span></pre></div>
<a id="trunkwpadminjsnavmenudevjs"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/js/nav-menu.dev.js (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/js/nav-menu.dev.js        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/js/nav-menu.dev.js        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -809,7 +809,6 @@
</span><span class="cx">                                 'menu-item-parent-id',
</span><span class="cx">                                 'menu-item-position',
</span><span class="cx">                                 'menu-item-type',
</span><del>-                                'menu-item-append',
</del><span class="cx">                                 'menu-item-title',
</span><span class="cx">                                 'menu-item-url',
</span><span class="cx">                                 'menu-item-description',
</span></span></pre></div>
<a id="trunkwpadminmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/menu.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/menu.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/menu.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -129,10 +129,9 @@
</span><span class="cx">         while ( isset($menu[$ptype_menu_position]) || in_array($ptype_menu_position, $core_menu_positions) )
</span><span class="cx">                 $ptype_menu_position++;
</span><span class="cx">
</span><del>-        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->label ), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon );
-        $submenu["edit.php?post_type=$ptype"][5] = array( __('Edit'), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype");
-        /* translators: add new custom post type */
-        $submenu["edit.php?post_type=$ptype"][10] = array( _x('Add New', 'post'), $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" );
</del><ins>+        $menu[$ptype_menu_position] = array( esc_attr( $ptype_obj->labels->name ), $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype", '', 'menu-top menu-icon-' . $ptype_class, 'menu-' . $ptype_class, $menu_icon );
+        $submenu["edit.php?post_type=$ptype"][5] = array( $ptype_obj->labels->edit, $ptype_obj->edit_type_cap, "edit.php?post_type=$ptype");
+        $submenu["edit.php?post_type=$ptype"][10] = array( $ptype_obj->labels->add_new, $ptype_obj->edit_type_cap, "post-new.php?post_type=$ptype" );
</ins><span class="cx">
</span><span class="cx">         $i = 15;
</span><span class="cx">         foreach ( $wp_taxonomies as $tax ) {
</span></span></pre></div>
<a id="trunkwpadminnavmenusphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/nav-menus.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/nav-menus.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/nav-menus.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -299,7 +299,7 @@
</span><span class="cx">
</span><span class="cx">                         if ( ! is_wp_error( $_menu_object ) ) {
</span><span class="cx">                                 $menu_items = wp_get_nav_menu_items( $nav_menu_selected_id, array('orderby' => 'ID', 'output' => ARRAY_A, 'output_key' => 'ID') );
</span><del>-                                $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-append', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );
</del><ins>+                                $post_fields = array( 'menu-item-db-id', 'menu-item-object-id', 'menu-item-object', 'menu-item-parent-id', 'menu-item-position', 'menu-item-type', 'menu-item-title', 'menu-item-url', 'menu-item-description', 'menu-item-attr-title', 'menu-item-target', 'menu-item-classes', 'menu-item-xfn' );
</ins><span class="cx">                                 wp_defer_term_counting(true);
</span><span class="cx">                                 // Loop through all the menu items' POST variables
</span><span class="cx">                                 if ( ! empty( $_POST['menu-item-db-id'] ) ) {
</span></span></pre></div>
<a id="trunkwpadminpostnewphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post-new.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post-new.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/post-new.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -26,7 +26,7 @@
</span><span class="cx">
</span><span class="cx"> $post_type_object = get_post_type_object($post_type);
</span><span class="cx">
</span><del>-$title = sprintf(__('Add New %s'), $post_type_object->singular_label);
</del><ins>+$title = $post_type_object->labels->add_new_item;
</ins><span class="cx">
</span><span class="cx"> $editing = true;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminpostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/post.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/post.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-admin/post.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -177,7 +177,7 @@
</span><span class="cx">                 wp_enqueue_script('autosave');
</span><span class="cx">         }
</span><span class="cx">
</span><del>-        $title = sprintf(__('Edit %s'), $post_type_object->singular_label);
</del><ins>+        $title = $post_type_object->labels->edit_item;
</ins><span class="cx">         $post = get_post_to_edit($post_id);
</span><span class="cx">
</span><span class="cx">         if ( post_type_supports($post_type, 'comments') ) {
</span></span></pre></div>
<a id="trunkwpincludesnavmenutemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu-template.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu-template.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-includes/nav-menu-template.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -155,10 +155,8 @@
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-object" name="menu-item[' . $possible_object_id . '][menu-item-object]" value="'. esc_attr( $item->object ) .'" />';
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-parent-id" name="menu-item[' . $possible_object_id . '][menu-item-parent-id]" value="'. esc_attr( $item->menu_item_parent ) .'" />';
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-type" name="menu-item[' . $possible_object_id . '][menu-item-type]" value="'. esc_attr( $item->type ) .'" />';
</span><del>-                $output .= '<input type="hidden" class="menu-item-append" name="menu-item[' . $possible_object_id . '][menu-item-append]" value="'. esc_attr( $item->append ) .'" />';
</del><span class="cx">                 $output .= '<input type="hidden" class="menu-item-title" name="menu-item[' . $possible_object_id . '][menu-item-title]" value="'. esc_attr( $item->title ) .'" />';
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-url" name="menu-item[' . $possible_object_id . '][menu-item-url]" value="'. esc_attr( $item->url ) .'" />';
</span><del>-                $output .= '<input type="hidden" class="menu-item-append" name="menu-item[' . $possible_object_id . '][menu-item-append]" value="'. esc_attr( $item->append ) .'" />';
</del><span class="cx">                 $output .= '<input type="hidden" class="menu-item-target" name="menu-item[' . $possible_object_id . '][menu-item-target]" value="'. esc_attr( $item->target ) .'" />';
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-attr_title" name="menu-item[' . $possible_object_id . '][menu-item-attr_title]" value="'. esc_attr( $item->attr_title ) .'" />';
</span><span class="cx">                 $output .= '<input type="hidden" class="menu-item-description" name="menu-item[' . $possible_object_id . '][menu-item-description]" value="'. esc_attr( $item->description ) .'" />';
</span></span></pre></div>
<a id="trunkwpincludesnavmenuphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/nav-menu.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/nav-menu.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-includes/nav-menu.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -231,7 +231,6 @@
</span><span class="cx">                 'menu-item-parent-id' => 0,
</span><span class="cx">                 'menu-item-position' => 0,
</span><span class="cx">                 'menu-item-type' => 'custom',
</span><del>-                'menu-item-append' => 'custom',
</del><span class="cx">                 'menu-item-title' => '',
</span><span class="cx">                 'menu-item-url' => '',
</span><span class="cx">                 'menu-item-description' => '',
</span><span class="lines">@@ -277,11 +276,7 @@
</span><span class="cx">                         $original_title = $original_object->post_title;
</span><span class="cx">
</span><span class="cx">                         if ( 'trash' == get_post_status( $args['menu-item-object-id'] ) ) {
</span><del>-                                $post_type_object = get_post_type_object( $args['menu-item-object'] );
-                                if ( isset( $post_type_object->singular_label ) )
-                                        return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to a %2$s that is in the trash, so it cannot be updated.'), $args['menu-item-title'], $post_type_object->singular_label ) );
-                                else
-                                        return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to something that is in the trash, so it cannot be updated.'), $args['menu-item-title'] ) );
</del><ins>+                                return new WP_Error('update_nav_menu_item_failed', sprintf(__('The menu item "%1$s" belongs to something that is in the trash, so it cannot be updated.'), $args['menu-item-title'] ) );
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><span class="cx">
</span><span class="lines">@@ -485,7 +480,7 @@
</span><span class="cx"> * - object_id:                The DB ID of the original object this menu item represents, e.g. ID for posts and term_id for categories.
</span><span class="cx"> * - type:                The family of objects originally represented, such as "post_type" or "taxonomy."
</span><span class="cx"> * - object:                The type of object originally represented, such as "category," "post", or "attachment."
</span><del>- * - append:                The singular label used to describe this type of menu item.
</del><ins>+ * - type_label:        The singular label used to describe this type of menu item.
</ins><span class="cx"> * - post_parent:        The DB ID of the original object's parent object, if any (0 otherwise).
</span><span class="cx"> * - menu_item_parent:         The DB ID of the nav_menu_item that is this item's menu parent, if any. 0 otherwise.
</span><span class="cx"> * - url:                The URL to which this menu item points.
</span><span class="lines">@@ -512,7 +507,7 @@
</span><span class="cx">
</span><span class="cx">                         if ( 'post_type' == $menu_item->type ) {
</span><span class="cx">                                 $object = get_post_type_object( $menu_item->object );
</span><del>-                                $menu_item->append = $object->singular_label;
</del><ins>+                                $menu_item->type_label = $object->labels->singular_name;
</ins><span class="cx">                                 $menu_item->url = get_permalink( $menu_item->object_id );
</span><span class="cx">
</span><span class="cx">                                 $original_object = get_post( $menu_item->object_id );
</span><span class="lines">@@ -521,14 +516,14 @@
</span><span class="cx">
</span><span class="cx">                         } elseif ( 'taxonomy' == $menu_item->type ) {
</span><span class="cx">                                 $object = get_taxonomy( $menu_item->object );
</span><del>-                                $menu_item->append = $object->singular_label;
</del><ins>+                                $menu_item->type_label = $object->singular_label;
</ins><span class="cx">                                 $menu_item->url = get_term_link( (int) $menu_item->object_id, $menu_item->object );
</span><span class="cx">
</span><span class="cx">                                 $original_title = get_term_field( 'name', $menu_item->object_id, $menu_item->object, 'raw' );
</span><span class="cx">                                 $menu_item->title = '' == $menu_item->post_title ? $original_title : $menu_item->post_title;
</span><span class="cx">
</span><span class="cx">                         } else {
</span><del>-                                $menu_item->append = __('Custom');
</del><ins>+                                $menu_item->type_label = __('Custom');
</ins><span class="cx">                                 $menu_item->title = $menu_item->post_title;
</span><span class="cx">                                 $menu_item->url = get_post_meta( $menu_item->ID, '_menu_item_url', true );
</span><span class="cx">                         }
</span><span class="lines">@@ -548,7 +543,7 @@
</span><span class="cx">
</span><span class="cx">                         $object = get_post_type_object( $menu_item->post_type );
</span><span class="cx">                         $menu_item->object = $object->name;
</span><del>-                        $menu_item->append = strtolower( $object->singular_label );
</del><ins>+                        $menu_item->type_label = $object->labels->singular_name;
</ins><span class="cx">
</span><span class="cx">                         $menu_item->title = $menu_item->post_title;
</span><span class="cx">                         $menu_item->url = get_permalink( $menu_item->ID );
</span><span class="lines">@@ -569,7 +564,7 @@
</span><span class="cx">
</span><span class="cx">                 $object = get_taxonomy( $menu_item->taxonomy );
</span><span class="cx">                 $menu_item->object = $object->name;
</span><del>-                $menu_item->append = strtolower( $object->singular_label );
</del><ins>+                $menu_item->type_label = $object->singular_label;
</ins><span class="cx">
</span><span class="cx">                 $menu_item->title = $menu_item->name;
</span><span class="cx">                 $menu_item->url = get_term_link( $menu_item, $menu_item->taxonomy );
</span></span></pre></div>
<a id="trunkwpincludespostphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-includes/post.php (14570 => 14571)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-includes/post.php        2010-05-11 19:19:59 UTC (rev 14570)
+++ trunk/wp-includes/post.php        2010-05-11 19:52:50 UTC (rev 14571)
</span><span class="lines">@@ -16,8 +16,6 @@
</span><span class="cx"> */
</span><span class="cx"> function create_initial_post_types() {
</span><span class="cx">         register_post_type( 'post', array(
</span><del>-                'label' => __( 'Posts' ),
-                'singular_label' => __( 'Post' ),
</del><span class="cx">                 'public' => true,
</span><span class="cx">                 'show_ui' => false,
</span><span class="cx">                 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
</span><span class="lines">@@ -30,8 +28,6 @@
</span><span class="cx">         ) );
</span><span class="cx">
</span><span class="cx">         register_post_type( 'page', array(
</span><del>-                'label' => __( 'Pages' ),
-                'singular_label' => __( 'Page' ),
</del><span class="cx">                 'public' => true,
</span><span class="cx">                 'show_ui' => false,
</span><span class="cx">                 '_builtin' => true, /* internal use only. don't use this when registering your own post type. */
</span><span class="lines">@@ -769,35 +765,33 @@
</span><span class="cx"> *
</span><span class="cx"> * Optional $args contents:
</span><span class="cx"> *
</span><del>- * label - A (plural) descriptive name for the post type marked for translation. Defaults to $post_type.
- * singular_label - A (singular) descriptive name for the post type marked for translation. Defaults to $label.
- * description - A short descriptive summary of what the post type is. Defaults to blank.
- * public - Whether posts of this type should be shown in the admin UI. Defaults to false.
- * exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public.
- * publicly_queryable - Whether post_type queries can be performed from the front page. Defaults to whatever public is set as.
- * show_ui - Whether to generate a default UI for managing this post type. Defaults to true if the type is public, false if the type is not public.
- * menu_position - The position in the menu order the post type should appear. Defaults to the bottom.
- * menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
- * inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none.
- * capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to "post".
- * edit_cap - The capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post).
- * edit_type_cap - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
- * edit_others_cap - The capability that controls editing objects of this post type that are owned by other users. Defaults to "edit_others_ . $capability_type . s" (edit_others_posts).
- * publish_others_cap - The capability that controls publishing objects of this post type. Defaults to "publish_ . $capability_type . s" (publish_posts).
- * read_cap - The capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post).
- * delete_cap - The capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post).
- * hierarchical - Whether the post type is hierarchical. Defaults to false.
- * supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none.
- * register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
- * taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
- *
- * @package WordPress
- * @subpackage Post
</del><ins>+ * - description - A short descriptive summary of what the post type is. Defaults to blank.
+ * - public - Whether posts of this type should be shown in the admin UI. Defaults to false.
+ * - exclude_from_search - Whether to exclude posts with this post type from search results. Defaults to true if the type is not public, false if the type is public.
+ * - publicly_queryable - Whether post_type queries can be performed from the front page. Defaults to whatever public is set as.
+ * - show_ui - Whether to generate a default UI for managing this post type. Defaults to true if the type is public, false if the type is not public.
+ * - menu_position - The position in the menu order the post type should appear. Defaults to the bottom.
+ * - menu_icon - The url to the icon to be used for this menu. Defaults to use the posts icon.
+ * - inherit_type - The post type from which to inherit the edit link and capability type. Defaults to none.
+ * - capability_type - The post type to use for checking read, edit, and delete capabilities. Defaults to "post".
+ * - edit_cap - The capability that controls editing a particular object of this post type. Defaults to "edit_$capability_type" (edit_post).
+ * - edit_type_cap - The capability that controls editing objects of this post type as a class. Defaults to "edit_ . $capability_type . s" (edit_posts).
+ * - edit_others_cap - The capability that controls editing objects of this post type that are owned by other users. Defaults to "edit_others_ . $capability_type . s" (edit_others_posts).
+ * - publish_others_cap - The capability that controls publishing objects of this post type. Defaults to "publish_ . $capability_type . s" (publish_posts).
+ * - read_cap - The capability that controls reading a particular object of this post type. Defaults to "read_$capability_type" (read_post).
+ * - delete_cap - The capability that controls deleting a particular object of this post type. Defaults to "delete_$capability_type" (delete_post).
+ * - hierarchical - Whether the post type is hierarchical. Defaults to false.
+ * - supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none.
+ * - register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form. Do remove_meta_box() and add_meta_box() calls in the callback.
+ * - taxonomies - An array of taxonomy identifiers that will be registered for the post type. Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
+ * - labels - An array of labels for this post type. You can see accepted values in {@link get_post_type_labels()}. By default post labels are used for non-hierarchical types and page labels for hierarchical ones.
+ *
</ins><span class="cx"> * @since 2.9.0
</span><span class="cx"> * @uses $wp_post_types Inserts new post type object into the list
</span><span class="cx"> *
</span><span class="cx"> * @param string $post_type Name of the post type.
</span><span class="cx"> * @param array|string $args See above description.
</span><ins>+ * @return object the registered post type object
</ins><span class="cx"> */
</span><span class="cx"> function register_post_type($post_type, $args = array()) {
</span><span class="cx">         global $wp_post_types, $wp_rewrite, $wp;
</span><span class="lines">@@ -806,7 +800,13 @@
</span><span class="cx">                 $wp_post_types = array();
</span><span class="cx">
</span><span class="cx">         // Args prefixed with an underscore are reserved for internal use.
</span><del>-        $defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true );
</del><ins>+        $defaults = array(
+                'labels' => array(), 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null,
+                '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false,
+                'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null,
+                'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null,
+                'permalink_epmask' => EP_PERMALINK, 'can_export' => true,
+        );
</ins><span class="cx">         $args = wp_parse_args($args, $defaults);
</span><span class="cx">         $args = (object) $args;
</span><span class="cx">
</span><span class="lines">@@ -825,12 +825,6 @@
</span><span class="cx">         if ( null === $args->exclude_from_search )
</span><span class="cx">                 $args->exclude_from_search = !$args->public;
</span><span class="cx">
</span><del>-        if ( false === $args->label )
-                $args->label = $post_type;
-
-        if ( false === $args->singular_label )
-                $args->singular_label = $args->label;
-
</del><span class="cx">         if ( empty($args->capability_type) )
</span><span class="cx">                 $args->capability_type = 'post';
</span><span class="cx">         if ( empty($args->edit_cap) )
</span><span class="lines">@@ -880,6 +874,13 @@
</span><span class="cx">         if ( $args->register_meta_box_cb )
</span><span class="cx">                 add_action('add_meta_boxes_' . $post_type, $args->register_meta_box_cb, 10, 1);
</span><span class="cx">
</span><ins>+        $args->labels = get_post_type_labels( $args );
+        
+        // we keep these two only for backwards compatibility
+        // TODO: remove in 3.1        
+        $args->label = $args->labels->name;
+        $args->singular_label = $args->labels->singular_name;
+
</ins><span class="cx">         $wp_post_types[$post_type] = $args;
</span><span class="cx">
</span><span class="cx">         add_action( 'future_' . $post_type, '_future_post_hook', 5, 2 );
</span><span class="lines">@@ -892,6 +893,61 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * Builds an object with all post type labels out of a post type object
+ *
+ * Accepted keys of the label array in the post type object:
+ * - name - general name for the post type, usually plural. Default is Posts/Pages
+ * - singular_name - name for one object of this post type. Default is Post/Page
+ * - add_new - Default is Add New for both hierarchical and non-hierarchical types. When internationalizing this string, please use a {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context gettext context} matching your post type. Example: <code>_x('Add New', 'product');</code>
+ * - add_new_item - Default is Add New Post/Add New Page
+ * - edit_item - Default is Edit Post/Edit Page
+ * - edit - Default is Edit. When internationalizing this string, please use a {@link http://codex.wordpress.org/I18n_for_WordPress_Developers#Disambiguation_by_context gettext context} matching your post type. Example: <code>_x('Edit', 'product');</code>
+ * - new_item - Default is New Post/New Page
+ * - view_item - Default is View Post/View Page
+ * - search_items - Default is Search Posts/Search Pages
+ * - not_found - Default is No posts found/No pages found
+ * - not_found_in_trash - Default is No posts found in Trash/No pages found in Trash
+ * - parent - This string isn't used on non-hierarchical types. In hierarchical ones the default is Parent Page:
+ *
+ * Above, the first default value is for non-hierarchical post types (like posts) and the second one is for hierarchical post types (like pages.)
+ *
+ * @since 3.0.0
+ * @param object $post_type_object
+ * @return object object with all the labels as member variables
+ */
+function get_post_type_labels( $post_type_object ) {
+        $nohier_vs_hier_defaults = array(
+                'name' => array( _x('Posts', 'post type general name'), _x('Pages', 'post type general name') ),
+                'singular_name' => array( _x('Post', 'post type singular name'), _x('Page', 'post type singular name') ),
+                'add_new' => array( _x('Add New', 'post'), _x('Add New', 'page') ),
+                'add_new_item' => array( __('Add New Post'), __('Add New Page') ),
+                'edit_item' => array( __('Edit Post'), __('Edit Page') ),
+                'edit' => array( _x('Edit', 'post'), _x('Edit', 'page') ),
+                'new_item' => array( __('New Post'), __('New Page') ),
+                'view_item' => array( __('View Post'), __('View Page') ),
+                'search_items' => array( __('Search Posts'), __('Search Pages') ),
+                'not_found' => array( __('No posts found'), __('No pages found') ),
+                'not_found_in_trash' => array( __('No posts found in Trash'), __('No pages found in Trash') ),
+                'view' => array( __('View Post'), __('View Page') ),
+                'parent' => array( null, __('Parent Page:') )
+        );
+        
+        // try to get missing (singular_)?name from older style (singular_)?label member variables
+        // we keep that for backwards compatibility
+        // TODO: remove in 3.1
+        if ( !isset( $post_type_object->labels['name'] ) && isset( $post_type_object->label ) ) {
+                $post_type_object->labels['name'] = $post_type_object->label;
+        }
+        if ( !isset( $post_type_object->labels['singular_name'] ) && isset( $post_type_object->singular_label ) ) {
+                $post_type_object->labels['singular_name'] = $post_type_object->singular_label;
+        }
+        
+        $defaults = array_map( create_function( '$x', $post_type_object->hierarchical? 'return $x[1];' : 'return $x[0];' ), $nohier_vs_hier_defaults );
+        $labels = array_merge( $defaults, $post_type_object->labels );
+        return (object)$labels;
+}
+
+/**
</ins><span class="cx"> * Register support of certain features for a post type.
</span><span class="cx"> *
</span><span class="cx"> * All features are directly associated with a functional area of the edit screen, such as the
</span></span></pre>
</div>
</div>
</body>
</html>