BP_Component:: register_global_tables (数组美元的表=数组())
为组件注册全局表,这样它就可以使用WordPress的数据库API。
描述
参数
- 美元的表
-
(数组)(可选)要注册的表名。
默认值:数组()
源
文件:bp-core /类/ class-bp-component.php
public function register_global_tables($tables = array()){/** *过滤组件的全局表,以便它可以使用WordPress的数据库API。这是一个基于组件字符串ID的动态钩子。*允许对表名进行组件特定的过滤。要过滤* *all*表,请使用'bp_core_get_table_prefix'过滤器。* * @since BuddyPress 1.6.0 */ $tables = apply_filters('bp_'。$ this - > id。_global_tables,美元表);//添加到BuddyPress全局对象。If (!empty($tables) && is_array($tables)) {foreach ($tables as $global_name => $table_name) {$this->$global_name = $table_name;} //保存组件中元数据表的记录。 $this->global_tables = $tables; } /** * Fires at the end of the register_global_tables method inside BP_Component. * * This is a dynamic hook that is based on the component string ID. * * @since BuddyPress 2.0.0 */ do_action( 'bp_' . $this->id . '_register_global_tables' ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 2.0.0 | 介绍了。 |