Articles of admin menu

Saving checkbox/option list status?

my self-made admin panel works just fine, but it doesn’t save values of form inputs. When I type something into textbox and click “save” it is still there after refreshing, thanks to PHP: <input type=”text” name=”header” value=”<?php echo get_option(‘header’); ?>” /> So the PHP echoes its own value to a input and everything is just […]

Remove menus and submenus

So I found some handy snippets to help remove admin menu items. However, I’m having trouble with the sub menu items. I want to keep the appearance menu, but get rid of the Themes, Widgets, and Editor. function remove_menus() { global $menu; global $current_user; get_currentuserinfo(); if($current_user->user_login == ‘username’) { $restricted = array(__(‘Posts’), __(‘Links’), __(‘Comments’), __(‘Plugins’), […]

Associating custom submenu item with post type of top level menu item

I’m working on a plugin that sets admin menu submenu pages on all different post types. I need to be able to associate these new submenu pages with the corresponding post type of the top level menu item. Is this possible without having to rely on using $_GET? I see that $typenow is used on […]

remove_menu_page breaks “Add media”

Using the the remove_menu_page function results in a really strange bug. By adding the code below in the functions.php file the integrated “Add media” widget starts to bug. function remove_menu_pages() { // Remove admin menu pages that are not used remove_menu_page( ‘link-manager.php’ ); remove_menu_page( ‘tools.php’ ); } add_action( ‘admin_init’, ‘remove_menu_pages’ ); When clicking “Add Media” […]

Trying to add script to specific admin page is not working

What I am trying to achieve is to load a .js file on an edit.php page, however the code is not working specifically for this page. I’ve applied the same code type of code to other CPT pages, but for some reason this CPT page is not registering the script. Here is the code I […]

Reorder plugin items in the admin menu

Is it possible to reorder plugin menu items and custom admin items in the Admin menu without modifying the position in the plugin itself? I’ve tried using the method described here “Changing the Menu Order”, but when you add a page link like admin.php?page=pluginname, it doesn’t do anything. Guessing because it can’t overwrite the position […]

$wp_customize->remove_section for customizer setting?

I use an underscores theme and try to remove the nav menu without any result : $wp_customize->remove_section(‘colors’); // works $wp_customize->remove_section(‘background_image’); // ok $wp_customize->remove_section(‘header_image’); // ok $wp_customize->remove_section(‘static_front_page’); // ok $wp_customize->remove_panel(‘widgets’); // ok $wp_customize->remove_panel(‘menu_navs’); // not ok $wp_customize->remove_section(‘menu_navs’); // not ok What’s wrong ?

How to hide menu on WordPress admin

I want to hide some menus on admin panel: Appearance, Plugins, and Tools. How to hide it without plugin? And how can I un-hide them later easily?

Add a Menu Link (to a WordPress Page) in the Admin Menu/Sidebar

I am trying to add a link, in the Admin Sidebar, that links to one of the pages I’ve created in the PAGES section. For example, I’ve created an ABOUT page. So in the sidebar I would like a link to “About” that loads this link: post.php?post=7&action=edit Why? I am trying to do this because […]

wp_redirect not working on admin menu page

Im trying to create a admin menu link on the backend dashboard, that will take users to the front end of their site. Im trying to use this code, but for some reason the redirect is not working. // Custom Menus add_action(‘admin_menu’, ‘register_web_menu_page’); function register_web_menu_page() { add_menu_page(‘View My Website’, ‘View My Website’, ‘add_users’, ‘web_menu_page’, ‘web_menu_page’, […]