Skip to content

Instantly share code, notes, and snippets.

@fernandofuly
Created April 7, 2015 19:11
Show Gist options
  • Save fernandofuly/2e2b353377ec70835d12 to your computer and use it in GitHub Desktop.
Save fernandofuly/2e2b353377ec70835d12 to your computer and use it in GitHub Desktop.
Rename Label "Posts" in Admin Menu
function change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Artigos';
$submenu['edit.php'][5][0] = 'Artigos';
$submenu['edit.php'][10][0] = 'Adicionar Artigo';
$submenu['edit.php'][15][0] = 'Status'; // Change name for categories
$submenu['edit.php'][16][0] = 'Labels'; // Change name for tags
echo '';
}
function change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'Artigos';
$labels->singular_name = 'Artigo';
$labels->add_new = 'Adicionar Artigo';
$labels->add_new_item = 'Adicionar Artigo';
$labels->edit_item = 'Editar Artigo';
$labels->new_item = 'Artigo';
$labels->view_item = 'Ver Artigo';
$labels->search_items = 'Procurar Artigos';
$labels->not_found = 'Nenhum Artigo encontrado';
$labels->not_found_in_trash = 'Nenhum Artigo encontrado na Lixeira';
}
add_action( 'init', 'change_post_object_label' );
add_action( 'admin_menu', 'change_post_menu_label' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment