Skip to content

Instantly share code, notes, and snippets.

@Jany-M
Created April 8, 2016 14:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jany-M/ed58ee6d44eca8675fb4fe06f22c8755 to your computer and use it in GitHub Desktop.
Save Jany-M/ed58ee6d44eca8675fb4fe06f22c8755 to your computer and use it in GitHub Desktop.
[WordPress] Go to All Posts by default, not Mine
<?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