[buddypress-trac] [BuddyPress] #4751: remove action bp_member_header_actions priority wonky
buddypress-trac
noreply at wordpress.org
Thu Feb 14 06:34:33 UTC 2013
#4751: remove action bp_member_header_actions priority wonky
-------------------------------------+------------------
Reporter: modemlooper | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone:
Component: Theme | Version: 1.7
Severity: normal | Resolution:
Keywords: reporter-feedback close |
-------------------------------------+------------------
Changes (by r-a-y):
* keywords: reporter-feedback => reporter-feedback close
* milestone: Awaiting Review =>
Comment:
It's an action firing thing.
All the member header actions are added during the `'after_setup_theme'`
hook, which runs after `'plugins_loaded'` or `'bp_include'`:
https://buddypress.trac.wordpress.org/browser/trunk/bp-core/bp-core-
actions.php#L88 (theme compat)
https://buddypress.trac.wordpress.org/browser/trunk/bp-themes/bp-
default/functions.php#L141 (bp-default)
Therefore, in this case, you need to run your code after the
`'after_setup_theme'` hook.
If we use your example `remove_add_friend()` function, you can do the
following at the earliest juncture:
{{{
function remove_add_friend() {
remove_action( 'bp_member_header_actions',
'bp_add_friend_button', 5 );
}
add_action( 'after_setup_theme', 'remove_add_friend', 11 );
}}}
I'm guessing you were running your code at an earlier hook like
`'bp_include'`, which is why your remove_action() was not working as
intended.
--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/4751#comment:4>
BuddyPress <http://buddypress.org/>
BuddyPress
More information about the buddypress-trac
mailing list