Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'admin_menu', 'ten80_default_published_posts' );
- function ten80_default_published_posts(){
- global $submenu;
- // POSTS
- foreach( $submenu['edit.php'] as $key => $value ){
- if( in_array( 'edit.php', $value ) ){
- $submenu['edit.php'][ $key ][2] = 'edit.php?post_status=publish&post_type=post';
- }
- }
- // OTHER POST TYPES
- $cpt = array( 'page', 'portfolio' ); // <--- remove or adapt the portfolio post type
- foreach( $cpt as $pt ){
- foreach( $submenu[ 'edit.php?post_type=' . $pt ] as $key => $value ){
- if( in_array( 'edit.php?post_type=' . $pt, $value ) ){
- $submenu[ 'edit.php?post_type='.$pt ][ $key ][2] = 'edit.php?post_status=publish&post_type=' . $pt;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement