[wp-hackers] Custom edit posts screen

Rob Miller rob at bigfish.co.uk
Tue Dec 14 10:36:01 UTC 2010


Hi guys,

Does anyone know of a method to modify the posts displayed on the edit posts screen, either through the query string or programmatically?

Essentially, I want to display an admin screen, identical to the regular `wp-admin/edit.php`, of posts that have a certain meta value.

In WP 3.0, I used the (possibly hacky) method of creating an admin page in which I queried the posts I wanted, then faked the global `$current_screen` object to match the one in `wp-admin/edit.php`, and then simply included `wp-admin/edit-post-rows.php`. This has unfortunately stopped working in WP 3.1, though — as perhaps such a bodged solution was always destined to to!

So, is there a better method? My initial hope before I used the hacky solution was just that I could pass query vars into the URL directly (i.e. that I could just link to `wp-admin/edit.php?meta_key=foo&meta_value=bar`), but that doesn't seem to be possible. Google doesn't turn up anything, but I might just be failing at search terms. Does anyone have any ideas?

I thought about filtering `the_request` and only modifying the request on certain admin pages, but it seemed overly general and unnecessary — perhaps it's the only solution, though.

Thanks,
Rob


More information about the wp-hackers mailing list