Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I can't remove a filter that added by media-tags plugin. it was originally added this way:

add_filter( 'attachment_fields_to_edit', 'mediatags_show_fields_to_edit', 11, 2 );

I tried to remove it this way:

remove_filter( 'attachment_fields_to_edit','mediatags_show_fields_to_edit', 11, 2 );

Where I did wrongly? How can I remove this filter?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

It depends on the call sequence. Are you sure that the remove_filter is called after the add_filter and before the attachment_fields_to_edit filter is invoked? Add few trace statements and verify.

share|improve this answer
    
the original filter was added inside a function that hooked up with 'admin_init'. My remove_filter is hooked up with my plugin's init. I will try to change my hook to see how. thanks! –  Jenny Jun 6 '12 at 6:47
    
You can use the same hook admin_init with a lower priority to ensure that your method is called later. –  KDM Jun 6 '12 at 6:50
    
Thanks! it works with your solution! –  Jenny Jun 6 '12 at 9:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.