Skip to:
Content

BuddyPress.org

Ticket #4228: filter-global-tables.diff

File filter-global-tables.diff, 1.0 KB (added by sbrajesh, 13 years ago)
  • bp-core/bp-core-component.php

     
    147147                $this->notification_callback = apply_filters( 'bp_' . $this->id . '_notification_callback', $r['notification_callback'] );
    148148
    149149                // Setup global table names
    150                 if ( !empty( $r['global_tables'] ) )
     150                if ( !empty( $r['global_tables'] ) ){
     151                    //allow filtering of the tables used by component
     152                    $r['global_tables']=apply_filters('bp_global_tables',$r['global_tables'],$this->id);//using bp_global_tables over 'bp_' . $this->id.'_global_tables' has additional advatnage that a single function can catch all the tables and process it
    151153                        foreach ( $r['global_tables'] as $global_name => $table_name )
    152154                                $this->$global_name = $table_name;
    153 
     155                }       
    154156                /** BuddyPress ********************************************************/
    155157
    156158                // Register this component in the loaded components array