Skip to:
Content

BuddyPress.org

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#4228 closed enhancement (fixed)

Allow filtering Global tables for the component

Reported by: sbrajesh Owned by:
Milestone: 1.6 Priority: normal
Severity: normal Version: 1.5.5
Component: Core Keywords: has-patch
Cc: sbrajesh

Description

Hi,
One of my plugins allows creating multiple social network on a wordpress Multisite/BuddyPress site. Thanks to the filters allowed on buddypress table prefix, It works for the generic scenerio when we want all the components of a sub network to be different from the other sub network.

In some of the cases, people want to keep global profile or activity but the groups etc localized to individual social network. It can be accomplished easily if it was possible to filter the individual global tables for each component.

Here is a patch attached, which allows to filter that for the components.

Please let me know if it is feasible to include it in Bp 1.6.

Thanks
Brajesh

Attachments (1)

filter-global-tables.diff (1.0 KB) - added by sbrajesh 8 years ago.

Download all attachments as: .zip

Change History (4)

#1 @boonebgorges
8 years ago

  • Milestone changed from Awaiting Review to 1.6

I don't have a problem with a filter here, since we have filters on all the other properties set in this method.

I understand what you mean about 'bp_global_tables', but (a) we should be consistent about the way we name the filters here, and (b) the purpose of this filter is to do component-specific filtering anyway, so I'm going to go with the 'bp_' . $this->id . '_global_tables' filter format. You can still use a single function, you just have to hook it to multiple filters:

add_filter( 'bp_xprofile_global_tables', 'foo' );
add_filter( 'bp_activity_global_tables', 'foo' );
// etc

and just do your switch case inside of the foo() function.

#2 @boonebgorges
8 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [6055]) Introduces a filter on global table names in BP_Component::setup_globals()

When a component registers its globals using BP_Component::setup_globals(),
most of the properties are run through a high-level filter. The one exception
is global_tables, meaning that developers have been limited in the way they
can customize data storage.

Among other things, this change will make it easier to have fine-grained
control over how multi-network BP setups work.

Fixes #4228
Props sbrajesh

#3 @sbrajesh
8 years ago

Hi Boone,
Thank you. I appreciate the quick resolution.

I agree that we should keep the naming convention consistent.the current implementation in r6055 works fine for me :)

Note: See TracTickets for help on using tickets.