[buddypress-trac] [BuddyPress Trac] #7318: Cleanup incorrect remove_action() & remove_filter() usage (was: Cleanup incorrect remove_action() usage)

buddypress-trac noreply at wordpress.org
Thu Nov 3 21:37:59 UTC 2016


#7318: Cleanup incorrect remove_action() & remove_filter() usage
----------------------------+------------------
 Reporter:  slaFFik         |       Owner:
     Type:  defect (bug)    |      Status:  new
 Priority:  normal          |   Milestone:  2.8
Component:  Core            |     Version:
 Severity:  normal          |  Resolution:
 Keywords:  good-first-bug  |
----------------------------+------------------
Description changed by slaFFik:

Old description:

> WordPress function `remove_action()` has 3 params:
>
> {{{
> remove_action( $tag, $function_to_remove, $priority = 10 )
> }}}
>
> While in some places in BuddyPress core it is called with 4 params, like
> this:
>
> {{{
> remove_action( 'bp_activity_before_save',
> 'bp_activity_check_moderation_keys', 2, 1 );
> }}}
>
> The 4th param should be removed as useless.

New description:

 WordPress functions `remove_action()` and `remove_filter()` have 3 params:

 {{{
 function remove_action( $tag, $function_to_remove, $priority = 10 ) {}
 function remove_filter( $tag, $function_to_remove, $priority = 10 ) {}
 }}}

 While in some places in BuddyPress core they are called with 4 params,
 like this:

 {{{
 remove_action( 'bp_activity_before_save',
 'bp_activity_check_moderation_keys', 2, 1 );
 remove_filter( 'bp_activity_generate_action_string',
 $actions->{$activity->component}->{$activity->type}['format_callback'],
 10, 2 );
 }}}

 The 4th param should be removed as useless.

--

--
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7318#comment:1>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list