Skip to:
Content

BuddyPress.org

Ticket #7318: patch.patch

File patch.patch, 11.9 KB (added by ketuchetan, 4 years ago)

Added patch for the remove_filter and remove_Action

  • bp-activity/bp-activity-admin.php

     
    393393                                         * Remove moderation and blacklist checks in case we want to ham an activity
    394394                                         * which contains one of these listed keys.
    395395                                         */
    396                                         remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2, 1 );
    397                                         remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2, 1 );
     396                                        remove_action( 'bp_activity_before_save', 'bp_activity_check_moderation_keys', 2);
     397                                        remove_action( 'bp_activity_before_save', 'bp_activity_check_blacklist_keys',  2);
    398398
    399399                                        bp_activity_mark_as_ham( $activity );
    400400                                        $result = $activity->save();
  • bp-activity/bp-activity-filters.php

     
    603603        ob_end_clean();
    604604
    605605        // Remove the temporary filter.
    606         remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1 );
     606        remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10);
    607607
    608608        if ( ! empty( $newest_activities['last_recorded'] ) ) {
    609609                $response['bp_activity_newest_activities'] = $newest_activities;
  • bp-activity/bp-activity-functions.php

     
    14451445        $action = apply_filters( 'bp_activity_generate_action_string', $activity->action, $activity );
    14461446
    14471447        // Remove the filter for future activity items.
    1448         remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10, 2 );
     1448        remove_filter( 'bp_activity_generate_action_string', $actions->{$activity->component}->{$activity->type}['format_callback'], 10);
    14491449
    14501450        return $action;
    14511451}
     
    33213321
    33223322        // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
    33233323        if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
    3324                 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
     3324                remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4);
    33253325
    33263326                // Build data package for Akismet.
    33273327                $activity_data = BP_Akismet::build_akismet_data_package( $activity );
     
    33683368
    33693369        // If Akismet is active, and this was a manual spam/ham request, stop Akismet checking the activity.
    33703370        if ( 'by_a_person' == $source && !empty( $bp->activity->akismet ) ) {
    3371                 remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4, 1 );
     3371                remove_action( 'bp_activity_before_save', array( $bp->activity->akismet, 'check_activity' ), 4);
    33723372
    33733373                // Build data package for Akismet.
    33743374                $activity_data = BP_Akismet::build_akismet_data_package( $activity );
  • bp-blogs/bp-blogs-activity.php

     
    961961        $old_comment_status  = $post_comment_status;
    962962
    963963        // No need to edit the activity, as it's the activity who's updating the comment
    964         remove_action( 'transition_comment_status',     'bp_activity_transition_post_type_comment_status', 10, 3 );
    965         remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment',          10, 4 );
     964        remove_action( 'transition_comment_status',     'bp_activity_transition_post_type_comment_status', 10);
     965        remove_action( 'bp_activity_post_type_comment', 'bp_blogs_comment_sync_activity_comment',          10);
    966966
    967967        if ( 1 === $activity->is_spam && 'spam' !== $post_comment_status ) {
    968968                wp_spam_comment( $post_comment_id );
  • bp-core/admin/bp-core-admin-functions.php

     
    11411141
    11421142        $loader = basename( constant( 'BP_PLUGIN_DIR' ) ) . '/bp-loader.php';
    11431143
    1144         remove_action( "after_plugin_row_{$loader}", 'wp_plugin_update_row', 10, 2 );
     1144        remove_action( "after_plugin_row_{$loader}", 'wp_plugin_update_row', 10);
    11451145        add_action( "after_plugin_row_{$loader}", 'bp_core_admin_php52_plugin_row', 10, 2 );
    11461146}
    11471147add_action( 'load-plugins.php', 'bp_core_admin_maybe_disable_update_row_for_php53_requirement', 100 );
  • bp-core/bp-core-functions.php

     
    23722372                return;
    23732373        }
    23742374
    2375         remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10, 0 );
     2375        remove_action( 'wp_head', 'adjacent_posts_rel_link_wp_head', 10);
    23762376}
    23772377add_action( 'bp_init', 'bp_remove_adjacent_posts_rel_link' );
    23782378
  • bp-core/classes/class-bp-attachment.php

     
    277277                }
    278278
    279279                // Remove the pre WordPress 4.0 static filter.
    280                 remove_filter( 'wp_handle_upload_prefilter', array( $this, 'validate_upload' ), 10, 1 );
     280                remove_filter( 'wp_handle_upload_prefilter', array( $this, 'validate_upload' ), 10);
    281281
    282282                // Finally return the uploaded file or the error.
    283283                return $this->attachment;
  • bp-core/deprecated/2.5.php

     
    701701                'settings-verify-email-change',
    702702        );
    703703
    704         remove_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20, 2 );
     704        remove_action( 'bp_send_email_success', 'bp_core_deprecated_email_actions', 20);
    705705        $email_content = $email->get( 'content' );
    706706        $email_subject = $email->get( 'subject' );
    707707        $email_type    = $email->get( 'type' );
  • bp-forums/bbpress/bb-includes/backpress/functions.plugin-api.php

     
    249249 * @param int $accepted_args optional. The number of arguments the function accpets (default: 1).
    250250 * @return boolean Whether the function existed before it was removed.
    251251 */
    252 function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
     252function remove_filter($tag, $function_to_remove, $priority = 10) {
    253253        $function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);
    254254
    255255        $r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);
     
    512512 * @param int $accepted_args optional. The number of arguments the function accpets (default: 1).
    513513 * @return boolean Whether the function is removed.
    514514 */
    515 function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {
    516         return remove_filter($tag, $function_to_remove, $priority, $accepted_args);
     515function remove_action($tag, $function_to_remove, $priority = 10) {
     516        return remove_filter($tag, $function_to_remove, $priority);
    517517}
    518518
    519519/**
  • bp-groups/bp-groups-template.php

     
    28302830
    28312831        bp_get_options_nav( $group->slug . '_manage' );
    28322832
    2833         remove_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10, 3 );
     2833        remove_filter( "bp_get_options_nav_{$css_id}", 'bp_group_admin_tabs_backcompat', 10);
    28342834}
    28352835
    28362836/**
  • bp-groups/classes/class-bp-group-member-query.php

     
    330330                }
    331331
    332332                // Don't filter other BP_User_Query objects on the same page.
    333                 remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10, 2 );
     333                remove_action( 'bp_user_query_populate_extras', array( $this, 'populate_group_member_extras' ), 10);
    334334        }
    335335
    336336        /**
  • bp-groups/classes/class-bp-groups-list-table.php

     
    722722                        'label'          => '',
    723723                        'show_all'       => true
    724724                ) );
    725                 remove_filter( 'bp_get_group_type_directory_permalink', array( $this, 'group_type_permalink_use_admin_filter' ), 10, 2 );
     725                remove_filter( 'bp_get_group_type_directory_permalink', array( $this, 'group_type_permalink_use_admin_filter' ), 10);
    726726
    727727                /**
    728728                 * Filters the markup for the Group Type column.
  • bp-members/bp-members-functions.php

     
    11621162        // As of BuddyPress 2.0, last_activity is no longer stored in usermeta.
    11631163        // However, we mirror it there for backward compatibility. Do not use!
    11641164        // Remove our warning and re-add.
    1165         remove_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
    1166         remove_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 3 );
     1165        remove_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10);
     1166        remove_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10);
    11671167        bp_update_user_meta( $user_id, 'last_activity', $time );
    11681168        add_filter( 'update_user_metadata', '_bp_update_user_meta_last_activity_warning', 10, 4 );
    11691169        add_filter( 'get_user_metadata', '_bp_get_user_meta_last_activity_warning', 10, 3 );
  • bp-members/classes/class-bp-members-admin.php

     
    13061306         * @since 2.1.0
    13071307         */
    13081308        public function remove_edit_profile_url_filter() {
    1309                 remove_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10, 3 );
     1309                remove_filter( 'bp_members_edit_profile_url', array( $this, 'filter_adminbar_profile_link' ), 10);
    13101310        }
    13111311
    13121312        /** Signups Management ****************************************************/
  • bp-templates/bp-legacy/buddypress-functions.php

     
    969969        }
    970970
    971971        if ( ! empty( $last_recorded ) ) {
    972                 remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1 );
     972                remove_filter( 'bp_get_activity_css_class', 'bp_activity_newest_class', 10);
    973973        }
    974974
    975975        exit;
  • bp-xprofile/bp-xprofile-filters.php

     
    328328 * - URL's are made clickable.
    329329 *
    330330 * To disable globally:
    331  *     remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 3 );
     331 *     remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9);
    332332 *
    333333 * To disable for a single field, use the 'Autolink' settings in Dashboard > Users > Profile Fields.
    334334 *