Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* RENAME POSTS & REARRANGE THE ADMIN MENU & REMOVE ITEMS */
- // Change Posts name
- function change_post_menu_label() {
- global $menu;
- global $submenu;
- $menu[5][0] = 'Blog';
- $submenu['edit.php'][5][0] = 'Blog Articles';
- $submenu['edit.php'][10][0] = 'Add Blog Article';
- //$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 = 'Blog Articles';
- $labels->singular_name = 'Blog Article';
- $labels->add_new = 'Add Article';
- $labels->add_new_item = 'Add Article';
- $labels->edit_item = 'Edit Articles';
- $labels->new_item = 'Blog Article';
- $labels->view_item = 'View Article';
- $labels->search_items = 'Search Articles';
- $labels->not_found = 'No Articles found';
- $labels->not_found_in_trash = 'No Articles found in Trash';
- }
- add_action( 'init', 'change_post_object_label' );
- add_action( 'admin_menu', 'change_post_menu_label' );
- // Rearrange the admin menu
- function custom_menu_order($menu_ord) {
- if (!$menu_ord) return true;
- return array(
- 'index.php', // Dashboard
- 'edit.php?post_type=page', // Pages
- 'edit.php?post_type=events', // Custom type one
- 'edit.php?post_type=galleries', // Custom type two
- 'edit.php', // Posts
- 'separator1', // First separator
- 'upload.php', // Media
- 'link-manager.php', // Links
- 'edit-comments.php', // Comments
- //'separator2', // Second separator
- 'themes.php', // Appearance
- 'plugins.php', // Plugins
- 'users.php', // Users
- 'tools.php', // Tools
- 'options-general.php', // Settings
- 'separator-last', // Last separator
- );
- }
- add_filter('custom_menu_order', 'custom_menu_order'); // Activate custom_menu_order
- add_filter('menu_order', 'custom_menu_order');
- // Remove admin menu items
- function remove_menus () {
- global $menu;
- $restricted = array(__('Comments'), __('Media'));
- end ($menu);
- while (prev($menu)){
- $value = explode(' ',$menu[key($menu)][0]);
- if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
- }
- }
- add_action('admin_menu', 'remove_menus');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement