Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add item_link and item_link_description labels
  • Loading branch information
gwwar committed Feb 24, 2021
commit 298bbd1007128fb4def74948e5b1ab774c3f10fa
12 changes: 10 additions & 2 deletions src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ function create_initial_post_types() {
'post',
array(
'labels' => array(
'name_admin_bar' => _x( 'Post', 'add new from admin bar' ),
'name_admin_bar' => _x( 'Post', 'add new from admin bar' ),
'item_link' => _x( 'Post Link', 'navigation link block title' ),
'item_link_description' => _x( 'A link to a post.', 'navigation link block description' ),
),
'public' => true,
'_builtin' => true, /* internal use only. don't use this when registering your own post type. */
Expand All @@ -46,7 +48,9 @@ function create_initial_post_types() {
'page',
array(
'labels' => array(
'name_admin_bar' => _x( 'Page', 'add new from admin bar' ),
'name_admin_bar' => _x( 'Page', 'add new from admin bar' ),
'item_link' => _x( 'Page Link', 'navigation link block title' ),
'item_link_description' => _x( 'A link to a page.', 'navigation link block description' ),
),
'public' => true,
'publicly_queryable' => false,
Expand Down Expand Up @@ -1703,6 +1707,8 @@ function _post_type_meta_capabilities( $capabilities = null ) {
* - `item_scheduled` - Label used when an item is scheduled for publishing. Default is 'Post scheduled.' /
* 'Page scheduled.'
* - `item_updated` - Label used when an item is updated. Default is 'Post updated.' / 'Page updated.'
* - `item_link` - Title for a navigation link block variation. Default null/null.
* - `item_link_description` - Description for a navigation link block variation. Default null/null.
*
* Above, the first default value is for non-hierarchical post types (like posts)
* and the second one is for hierarchical post types (like pages).
Expand Down Expand Up @@ -1757,6 +1763,8 @@ function get_post_type_labels( $post_type_object ) {
'item_reverted_to_draft' => array( __( 'Post reverted to draft.' ), __( 'Page reverted to draft.' ) ),
'item_scheduled' => array( __( 'Post scheduled.' ), __( 'Page scheduled.' ) ),
'item_updated' => array( __( 'Post updated.' ), __( 'Page updated.' ) ),
'item_link' => array( null, null ),
'item_link_description' => array( null, null ),
);
$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];

Expand Down
15 changes: 15 additions & 0 deletions src/wp-includes/taxonomy.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ function create_initial_taxonomies() {
'show_ui' => true,
'show_admin_column' => true,
'_builtin' => true,
'labels' => array(
'item_link' => _x( 'Category Link', 'navigation link block title' ),
'item_link_description' => _x( 'A link to a category.', 'navigation link block description' ),
),
'capabilities' => array(
'manage_terms' => 'manage_categories',
'edit_terms' => 'edit_categories',
Expand All @@ -91,6 +95,10 @@ function create_initial_taxonomies() {
'show_ui' => true,
'show_admin_column' => true,
'_builtin' => true,
'labels' => array(
'item_link' => _x( 'Tag Link', 'navigation link block title' ),
'item_link_description' => _x( 'A link to a tag.', 'navigation link block description' ),
),
'capabilities' => array(
'manage_terms' => 'manage_post_tags',
'edit_terms' => 'edit_post_tags',
Expand Down Expand Up @@ -576,6 +584,10 @@ function unregister_taxonomy( $taxonomy ) {
* @type string $items_list Label for the table hidden heading.
* @type string $most_used Title for the Most Used tab. Default 'Most Used'.
* @type string $back_to_items Label displayed after a term has been updated.
* @type string $item_link Title for a navigation link block variation.
* Default null/null.
* @type string $item_link_description Description for a navigation link block variation.
* Default null/null.
* }
*/
function get_taxonomy_labels( $tax ) {
Expand Down Expand Up @@ -613,6 +625,9 @@ function get_taxonomy_labels( $tax ) {
/* translators: Tab heading when selecting from the most used terms. */
'most_used' => array( _x( 'Most Used', 'tags' ), _x( 'Most Used', 'categories' ) ),
'back_to_items' => array( __( '← Go to Tags' ), __( '← Go to Categories' ) ),
'item_link' => array( null, null ),
'item_link_description' => array( null, null ),

);
$nohier_vs_hier_defaults['menu_name'] = $nohier_vs_hier_defaults['name'];

Expand Down