#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)
Change History (4)
#2
@
13 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
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:
and just do your switch case inside of the
foo()
function.