[wp-hackers] remove all functions with remove_action?
steve at sltaylor.co.uk
Mon Feb 1 23:30:12 UTC 2010
Ah, many thanks. I'm still a bit too reliant on what's made it into
the Codex ;-)
On 1 February 2010 23:11, Chris Jean <gaarai at gaarai.com> wrote:
> You should try the remove_all_actions function.
> Chris Jean
> On 02/01/2010 05:04 PM, Steve Taylor wrote:
>> I'm trying to completely remove the 'admin_notices' action, i.e.
>> everything attached to it, for non-admins. I'm testing for the admin
>> role with code specific to my custom theme, but basically I've got
>> if ( ! [test for admin] ) remove_action( 'admin_notices' );
>> It seems to do the trick, but I've noticed some non-fatal PHP warnings
>> being logged: "Missing argument 2 for remove_action()"
>> Checking the docs it does look like you need to specify the attached
>> function to remove. What if I want to get rid of them all, whatever
>> they are? This doesn't seem urgent because it kinda works, PHP warning
>> notwithstanding... but I thought I'd ask.
>> Steve Taylor
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers