[wp-hackers] Filtering metadata functions

Scott Kingsley Clark scott at skcdev.com
Thu Sep 2 18:17:55 UTC 2010


Okay, so you've obviously noticed the lack of ability to filter the 
metadata functions. Okay, you probably didn't, but if you have, you know 
some sort of filter would be great.

I've posted a patch for wp-includes/meta.php with what I feel would be a 
great addition for plugins to interact in a more complex way with meta 
data. This filter runs before any of the other WP stuff runs, but there 
could additionally be another filter that changes the value returned by 
the default WP metadata function itself.

The patch I'm suggesting, allows a plugin to add a filter to 
{ACTION}_{METATYPE}_metadata which could then stop the rest of the 
metadata function from running, effectively allowing some pretty complex 
stuff. The filters themselves filter a 'false', with additional 
variables attached to the filters. If the filter returns anything other 
than a boolean false, depending on the function, the function will 
return that value (or a boolean true). Usefulness galore, let me know if 
you have any thoughts or questions!

Here's the trac ticket:
http://core.trac.wordpress.org/ticket/14766


Best Regards,

Scott Kingsley Clark
Developer / Consultant
SKC Development, LLC

------------------------------------
E-mail: scott at skcdev.com
Website: http://skcdev.com/
Phone: 214.233.4048
Fax: 214.260.1426

AIM / Yahoo / Skype: sc0ttkclark
Google Talk: sc0ttkclark at gmail.com
------------------------------------




More information about the wp-hackers mailing list