I have a plugin that uses apply_filters
like this:
$additional_fields = apply_filters('attachment_meta_add_fields', $additional_fields);
In my theme's functions.php
, I do:
function addAttachmentMeta($additionalFields) {
return $addtionalFields;
}
add_filter( 'attachment_meta_add_fields', 'addAttachmentMeta', 1, 1 );
But the function addAttachmentMeta
never runs.
How can I alter my apply or add filter statements to make it so that addAttachmentMeta
gets called?
Edit: This is a custom plugin that I wrote based off tutorials on how to add additional attachment meta fields. The whole source is here: http://pastebin.com/7NcjDsK5. As I mentioned in the comments, I know this is running and working because I can add additional fields in this plugin file, but not by using the filters because the filter doesn't get added.
I can see var_dumps before and after the apply_filters
statement, but the function I've pointed to with add_filter
never gets called.