[wp-hackers] Custom post types filtering

Olivier autremonde75 at gmail.com
Tue Jun 29 12:16:03 UTC 2010


Hello,

The custom post type feature is nice! I'd like to be able to filter
custom posts listed on the edit page for custom post types. I can't
find any action filter for the wp query that retrieves the post list.
Everything is now performed dynamically based on the set of
capabilities but the current set of capabilities isn't complete enough
to achieve what I want.

Basically, here is what I would like to achieve :
1/ For the admins, show all posts
2/ For the non admins, only show posts authored by the user browsing
the table

Right now, I can restrict the edition but the posts can still be
viewed into the table.

I see two solutions to achieve this :
1/ either add a new capability called "read_others_posts" and then
fill the table based on it
2/ either add an action filter on the query so that we can add a query
var for the post author

Any other idea to make this directly work with WP 3.0?



More information about the wp-hackers mailing list