Is There a WordPress Hook to Filter the Edit Posts View?

I want to be able to customize the WordPress edit posts screen to filter based on a custom field (or whatever).

Unfortunately I’m not sure what filter or hook to use here, and instead of opening the code myself, figured I’d throw the question out here.

Read More

Just to be clear, I’m talking about this screen. Essentially I want to be able to add a new “tab” next to Drafts, Pending, etc.

enter image description here

Update
After testing this, here’s the solution:

add_filter( 'parse_query', 'filter_post_edit_screen' );
function filter_post_edit_screen($query) {
  global $pagenow;

  if (is_admin() && $pagenow=='edit.php'){
        $query->query_vars['category__not_in'] = array(120,9999);
  }
  return $query;
}

That’s it. Just paste that into a plugin. Obviously you’d tweak the category IDs or add some more substantial code.

Related posts

Leave a Reply

2 comments