Created
April 8, 2016 14:54
-
-
Save Jany-M/ed58ee6d44eca8675fb4fe06f22c8755 to your computer and use it in GitHub Desktop.
[WordPress] Go to All Posts by default, not Mine
This file contains hidden or 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 | |
// Go to All posts by default, not Mine | |
function go_to_all() { | |
global $typenow; | |
// Use this if you need this only on specific post types | |
/*if( 'post' !== $typenow ) | |
return;*/ | |
if( isset( $_GET['post_status'] ) ) return; | |
if(isset($_GET['all_posts'])) return; | |
if( !isset( $_GET['all_posts'] ) ) { | |
wp_redirect( admin_url('edit.php?post_type='.$typenow.'&all_posts=1') ); | |
exit(); | |
} | |
} | |
add_action( 'load-edit.php', 'go_to_all'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment