The code itself is fine. But you would need to activate the plug-in: you can’t simply place the file in the plug-ins directory. You will need to give the plug-in a ‘header’ too. See the Codex.
Alternatively, place the code in your theme’s functions.php, but really it should be in a plug-in.
Related Posts:
- Why am I timing out when using the Menu Editor?
- Add a Separator to the Admin Menu?
- Placing a Custom Post Type Menu Above the Posts Menu Using menu_position?
- Adding a custom admin page
- How to remove entire admin menu?
- Plugin to remove Admin menu items based on user role?
- Add separator to admin submenu
- Add my own button next to “Screen options” and “Help” in the admin
- How to show custom menu items in the WordPress android app?
- Remove ability to access certain admin menus
- renaming an admin menu item with decimal array index number
- Appearance->Editor not visible
- Custom WP_List_Table displays blank rows
- How do I fix this error: Warning: invalid argument supplied for foreach()?
- How do I set up a webhook?
- Add column to pages table
- Admin pages have no content
- Hide Admin menus per role in WordPress
- WordPress Left Hand Side Admin Menu Always Collapsed
- Reorder plugin items in the admin menu
- Re-ordering Admin Submenu Sections
- Reference external file as a function
- “Automatically add new top-level pages” Default
- How can I get an array/list of all current WordPress Admin Menu items?
- Add number new posts (post_status = pending) to administration menu [duplicate]
- how to only add a top-level admin menu without it creating a sub-level-menu
- add_submenu_page set for multiple roles [duplicate]
- How To Create User Specific Admin User Pages?
- Change the Default Pages Menu View in wp-admin
- How can I remove the “updates” menu in the WordPress Admin panel?
- Remove the whole menu in the admin
- How to change admin menu position of “Media”?
- Change top level menu item to point to custom submenu item
- Hiding Admin Page While Keeping Menu Expanded
- Associating custom submenu item with post type of top level menu item
- Admin doesn’t have sufficient permissions to plugin’s page
- Remove Admin sidebar link
- Single category’s posts list in admin menu
- Add column to pages table
- Dashboard menu missing
- WordPress Remove Submenus
- page not updating with database
- 500 internal server error on wp-admin only
- How can I POST or GET to the same admin page from which I am POST-ing or GET-ing
- Output the admin menu_position for each item
- avoiding the display of certain categories to certain user roles at content entry time
- Admin top level menu, pointing to an external url
- Backend Checkboxes working – but not visual?
- WordPress Admin Menu Order for ‘admin.php’ pages
- Give admin_menu permission to specific users
- Show all admin menus in a table
- Highlight active Admin Menu when added though add_menu_page
- require/include php file in add_menu()
- Create WordPress Menu Item Without Linking to a Custom Page
- wp_is_mobile() inside js
- Simple CSS admin pagination
- Appearance > Menus
- Is It Possible To A Link To The Homepage From The Admin Sidebar?
- How to change the default url for ‘Posts’ link?
- Unsure how to add simple checkboxes that write to a small table to admin
- Add a link to the Admin menu
- Reference external file as a function
- Display admin sidebar into custom post pages if logged
- The website cannot display the page
- Set Default Admin Colour For All Users
- initial sort order for a sortable custom column in admin
- Uploading files in admin panel?
- Get email address of type Administrator
- Calling a shortcode in the backend
- Is there a way to have admins that are logged in to wordpress not have to enter the password for password protected pages while browsing the website?
- How to receive security update notification email?
- How do I remove All and Published if not admin?
- Change name & menu_name for Profile in the default menu, w/o altering core files?
- Admin role not really admin
- Ordering Submenu Pages in WP 3.1
- Can I have custom post types in “Add menu items” on in the Admin > Appearance > Menu
- How do I diagnose a plugin resource 404?
- Creating custom admin panel pages without making a plugin?
- Page can’t hand request – HTTP ERROR 500 – when updating something
- How to change the User name and Password of admin account
- Posts in sidebar only by admin
- Display an image of selected template in admin to aid user when using complex templates
- How to remove the default checked attribute from inputs in admin?
- Admin user column sort by numeric meta key
- Shop in Subdomain feeding main domain order in admin area
- Add category label for appearance > menus items
- Can I retrieve Published changes when changes have been Saved but not Published in WordPress Semplice?
- I can’t access login page
- Admin Access for specific page(s)
- Get Link of Page Selected through a Select Field in Custom Admin Page
- Dashicons not showed for admin menu
- how to disable the e-mail verification on wp-admin/options-general.php multisite admin e-mail
- conditionally update css on edit.php
- Can I show the tag admin interface on a post when logged in as an admin?
- Customizing label/title output of admin nav_menu selecter
- Making a custom upload form and page in the admin section
- Custom Taxonomy Showing in WP Menu
- WordPress gallery image link gives 404 when not logged in
- New User Notification – Setting Email
- Woo Commerce Settings for Check-out Form [closed]