Making WordPress.org

Changeset 1415


Ignore:
Timestamp:
03/18/2015 10:49:53 PM (10 years ago)
Author:
coffee2code
Message:

Profiles Association Handler: Also change the groups meta table name via 'bp_groups_meta_tables' filter.

Fixes #918.
Props ocean90.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/profiles.wordpress.org/public_html/wp-content/plugins/wporg-profiles-association-handler/wporg-profiles-association-handler.php

    r1408 r1415  
    1919         */
    2020        public function __construct() {
    21             add_filter( 'bp_groups_global_tables', array( $this, 'change_table_names' ) );
     21            add_filter( 'bp_groups_global_tables', array( $this, 'change_global_table_names' ) );
     22            add_filter( 'bp_groups_meta_tables',   array( $this, 'change_meta_table_names' ) );
    2223            add_filter( 'bp_active_components',    array( $this, 'activate_groups_component' ) );
    2324            add_action( 'plugins_loaded',          array( $this, 'plugins_loaded' ) );
     
    4849         * @return array
    4950         */
    50         public function change_table_names( $tables ) {
     51        public function change_global_table_names( $tables ) {
    5152            global $bp;
    5253
     
    5657                'table_name_groupmeta' => $bp->table_prefix . 'wporg_groups_groupmeta',
    5758            );
     59        }
     60
     61        /**
     62         * Changes the meta table name to use custom wporg groups meta tables rather
     63         * than the ones for BuddyPress.org.
     64         *
     65         * @param  array $tables The default meta table.
     66         * @return array
     67         */
     68        public function change_meta_table_names( $tables ) {
     69            global $bp;
     70
     71            $tables['group'] = $bp->table_prefix . 'wporg_groups_groupmeta';
     72
     73            return $tables;
    5874        }
    5975
Note: See TracChangeset for help on using the changeset viewer.