Skip to content

Instantly share code, notes, and snippets.

@tacensi
Last active March 12, 2018 17:10
Show Gist options
  • Save tacensi/c3edb5c0aa7ce8da9c9e647e2a756d65 to your computer and use it in GitHub Desktop.
Save tacensi/c3edb5c0aa7ce8da9c9e647e2a756d65 to your computer and use it in GitHub Desktop.
Change post labels
// Modificando o nome dos Posts para Produtos
function mg_change_post_menu_label() {
global $menu;
global $submenu;
$menu[5][0] = 'Produtos';
$submenu['edit.php'][5][0] = 'Produtos';
$submenu['edit.php'][10][0] = 'Adicionar produto';
}
function mg_change_post_object_label() {
global $wp_post_types;
$labels = &$wp_post_types['post']->labels;
$labels->name = 'Produtos';
$labels->singular_name = 'Produto';
$labels->add_new = 'Novo produto';
$labels->add_new_item = 'Adicionar produto';
$labels->edit_item = 'Editar produtos';
$labels->new_item = 'Produto';
$labels->view_item = 'Ver produto';
$labels->search_items = 'Buscar produtos';
$labels->not_found = 'Nenhum produto encontrada';
$labels->not_found_in_trash = 'Nenhum produto na lixeira';
}
add_action( 'init', 'mg_change_post_object_label' );
add_action( 'admin_menu', 'mg_change_post_menu_label' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment