Ticket #4223 (closed enhancement: fixed)

Opened 2 years ago

Last modified 2 years ago

remove_filter should return (bool) something acually removed

Reported by: mdawaffe Assigned to: rob1n
Priority: normal Milestone: 2.3
Component: General Version: 2.2
Severity: normal Keywords: plugin api has-patch
Cc:

Description

Sometimes it's nice for plugins to be able to conditionally do something depending on whether or not the hook used to have that filter attatched to it.

For example, add the removed filter back to the hook at a different priority.

Marking as 2.2. Feel free to push it back.

Attachments

4223.diff (1.2 kB) - added by mdawaffe on 05/04/07 18:07:05.

Change History

05/04/07 18:07:05 changed by mdawaffe

  • attachment 4223.diff added.

05/04/07 19:00:21 changed by rob1n

  • owner changed from anonymous to rob1n.
  • milestone changed from 2.2 to 2.3.

I like the idea. And it's not necessarily life-threatening, so I'm pushing it to 2.3. If someone else thinks it should go into 2.2, please raise it.

05/04/07 19:00:29 changed by rob1n

  • keywords changed from plugin api to plugin api has-patch.

05/04/07 23:27:12 changed by rob1n

  • status changed from new to closed.
  • resolution set to fixed.

(In [5393]) Return based on whether the hook was removed or not. Props mdawaffe. fixes #4223

Note that this will almost definitely *not* affect existing implementations. The way most code is set up now is to just call remove_filter() or remove_action().

05/04/07 23:35:50 changed by giovannimcosta

Ops, I forgot something.... BLOGROLL didn't imported, no "links" from my blogroll were imported =/

05/04/07 23:38:23 changed by giovannimcosta

forget ! and please, forgive me I posted in wrong place, my browser colapsed and make this. sorry ok