BP_Group_Extension: _register ()

扩展的主设置程序。

描述

该方法包含主要的逻辑,用于设置扩展的配置,设置遗留插件的向后兼容性,以及将扩展的屏幕功能挂接到WP和BP中。

标记为' public '是因为它必须可以被add_action()访问。然而,您永远不需要自己调用这个方法——它会在加载顺序的正确点自动调用bp_register_group_extension ()

文件:bp-groups /类/ class-bp-group-extension.php

public function _register(){//检测和解析由遗留扩展设置的属性。$ this - > parse_legacy_properties ();//如果需要,初始化。这只会发生在//不调用parent::init()本身的遗留扩展。If (true !== $this->initialized) {$this->init();} //根据解析的参数设置一些配置值。$ this - > group_id = $ this - > get_group_id ();$ this - >蛞蝓= $ this - >参数(“鼻涕虫”);$ this - >名称= $ this - > params['名字'];$ this - >能见度= $ this - >参数(“可见性”); $this->nav_item_position = $this->params['nav_item_position']; $this->nav_item_name = $this->params['nav_item_name']; $this->display_hook = $this->params['display_hook']; $this->template_file = $this->params['template_file']; // Configure 'screens': create, admin, and edit contexts. $this->setup_screens(); // Configure access-related settings. $this->setup_access_settings(); // Mirror configuration data so it's accessible to plugins // that look for it in its old locations. $this->setup_legacy_properties(); // Hook the extension into BuddyPress. $this->setup_display_hooks(); $this->setup_create_hooks(); $this->setup_edit_hooks(); $this->setup_admin_hooks(); }

更新日志

更新日志
版本 描述
BuddyPress 1.1.0 介绍了。

问题吗?

我们总是很高兴帮助您处理代码或其他问题!搜索我们的开发人员文档联络支持,或与我们联系销售团队