Skip to content

Instantly share code, notes, and snippets.

@WerdsWords
Created August 4, 2013 01:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save WerdsWords/6148703 to your computer and use it in GitHub Desktop.
#30: nav_menu_meta_box_object
<?php
/**
* Rename category and tag menus accordion sections.
*
* @see wp_ajax_menu_get_metabox()
*
* @param object $item_object The menu meta box object, e.g. post, page, category, post_tag.
*
* @return object The filtered meta box object.
*/
function wpdocs_modify_categories_menu_box( $item_object ) {
// 'Categories' becomes 'Category Archives'
if ( 'category' == $item_object->name )
$item_object->labels->name = __( 'Category Archives', 'yourtextdomain' );
// 'Tags' becomes 'Tag Archives'
if ( 'post_tag' == $item_object->name )
$item_object->labels->name = __( 'Tag Archives', 'yourtextdomain' );
return $item_object;
}
add_filter( 'nav_menu_meta_box_object', 'wpdocs_modify_categories_menu_box' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment