Created
November 3, 2011 19:52
-
-
Save jaredatch/1337595 to your computer and use it in GitHub Desktop.
Add external link to admin menu in WordPress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Add external links to the admin menu | |
*/ | |
add_action( 'admin_menu' , 'ja_new_admin_menu_items' ); | |
function ja_new_admin_menu_items() { | |
global $submenu; | |
$url = get_bloginfo('url'); | |
/** | |
* edit.php - the parent slug, in this case will go under Posts. Using index.php would place it under Dashboard, etc. | |
* Scheduled - the name of the menu item | |
* manage_options - role which will see the link | |
* URL - speaks for itself :) | |
*/ | |
$submenu['edit.php'][501] = array( 'Scheduled', 'manage_options' , $url . '/wp-admin/edit.php?post_status=future&post_type=post' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
5 years on this was by far and away the easiest explanation to get a link added to my site. Thanks!