Forked from norcross/filter-pages-admin-link.php
Last active
August 29, 2015 14:04
-
-
Save chuckreynolds/0fa3af52462b5929e74d to your computer and use it in GitHub Desktop.
This will make the WordPress admin menu link to posts and pages but with the Published filter active by default.
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_action ( 'admin_menu', 'rkv_filter_admin_published_default' ); | |
function rkv_filter_admin_published_default() { | |
// call global submenu item | |
global $submenu; | |
// edit main link for posts | |
$submenu['edit.php'][5][2] = 'edit.php?post_status=publish'; | |
// edit main link for pages | |
$submenu['edit.php?post_type=page'][5][2] = 'edit.php?post_type=page&post_status=publish'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment