常见主题修改 for Impreza child theme

主题
 $labels->name = 'News';
$labels->singular_name = 'News';
$labels->add_new = 'Add News';
$labels->add_new_item = 'Add News';
$labels->edit_item = 'Edit News';
$labels->new_item = 'News';
$labels->view_item = 'View News';
$labels->search_items = 'Search News';
$labels->not_found = 'No results on News';
$labels->not_found_in_trash = 'No News in Trash';
$labels->name_admin_bar = 'Add News';

}

add_action( 'init', 'custom_post_object_label' );
add_action( 'admin_menu', 'custom_post_menu_label' );

// remove useless admin menu
function remove_menus(){
//remove_menu_page( 'index.php' ); //Dashboard
remove_menu_page( 'jetpack' ); //Jetpack*
//remove_menu_page( 'edit.php' ); //Posts
//remove_menu_page( 'upload.php' ); //Media
//remove_menu_page( 'edit.php?post_type=page' ); //Pages
remove_menu_page( 'edit-comments.php' ); //Comments
//remove_menu_page( 'themes.php' ); //Appearance
//remove_menu_page( 'plugins.php' ); //Plugins
remove_menu_page( 'users.php' ); //Users
remove_menu_page( 'tools.php' ); //Tools
remove_menu_page( 'options-general.php' ); //Settings
//remove_menu_page( 'us-theme-options' ); //theme impreza
remove_menu_page( 'vc-general' ); //composer
//remove_menu_page( 'wpseo_dashboard' ); //seo
//remove_menu_page( 'revslider' ); //slider
}
add_action( 'admin_menu', 'remove_menus' );

//change admin menu lable
function wpse_custom_menu_order( $menu_ord ) {
if ( !$menu_ord ) return true;

return array(

'index.php', // Dashboard
'us-theme-options', // Impreza
'edit.php?post_type=page', // Pages
'edit.php?post_type=us_portfolio', // Products
'edit.php', // Posts
'upload.php', // Media
'wpcf7', // Contact
'revslider', // Slider
'themes.php', // Appearance
'plugins.php', // Plugins
);
}
add_filter( 'custom_menu_order', 'wpse_custom_menu_order', 10, 1 );
add_filter( 'menu_order', 'wpse_custom_menu_order', 10, 1 );
Previous Post
10个WordPress主题库,你知道吗?
Next Post
WordPress 5.3 版本发布

相关文章

Menu