[wp-hackers] More Hook Requests
wphackers at jamietalbot.com
Fri Jan 13 13:57:32 GMT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Mark Jaquith wrote:
> On Jan 13, 2006, at 4:38 AM, Jamie Talbot wrote:
>> could we have the same kind of pair for the edit-pages.php table
>> 'manage_pages_columns' and 'manage_pages_custom_column'
> Reasonable hook requests such as this are rarely (ever?) turned down.
> Write a patch quick, and it might make it into 2.0.1!
Done! This patch adds hooks 'manage_pages_columns' and
'manage_pages_custom_column' that are the equivalent of
'manage_posts_columns' and 'manage_posts_custom_column'. You can call
them in exactly the same way, using the same callback functions:
'my_manage_posts_custom_column', 10, 2);
function my_manage_posts_columns(& $post_columns)
$post_columns['gengo_language'] = __('Language', GENGO_DOMAIN);
function my_manage_posts_custom_column($column_name, $id)
// Check it's our column.
if ('gengo_language' != $column_name) return;
As a side effect, it also now displays the Owner column correctly in all
cases, which it didn't seem to do in the past. It seems to present the
table correctly in all the situations I could throw at it, but it did
require a bit of code shifting around because of the way the logic was
set out previously, so please test it out and see how it goes.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the wp-hackers