bp_core_admin_get_directory_pages ()
生成目录页列表,以便在构建Components面板标记时使用。
描述
返回
(数组)
源
文件:bp-core / admin / bp-core-admin-slugs.php
函数bp_core_admin_get_directory_pages() {$bp = buddypress();数组$ directory_pages = ();//循环已加载的组件和收集目录。if (is_array($bp->loaded_components)) {foreach($bp->loaded_components as $component_slug => $component_id){//只有需要目录的组件才应该列在这里。如果(isset($bp->{$component_id}) && !empty($bp->{$component_id}->has_directory)){//在bp 1.5中引入了component->name属性,所以我们必须提供一个回调。($bp->{$component_id}->name) ?$bp->{$component_id}->name: ucwords($component_id);}} if (function_exists(' bp_nouveau_get_appance_settings ')) {if (bp_nouveau_get_appance_settings ('user_front_page')) {$directory_pages['profile_dashboard'] = __('Profile Dashboard', 'buddyboss');}} //添加新的论坛选项到页面。if (bp_is_active(' bbs ')) {if (bp_is_active('groups')) {$directory_pages = array_insert_after($directory_pages, 'groups', array('new_forums_page' => __('论坛','buddyboss')); } else { $directory_pages = array_insert_after( $directory_pages, 'members', array( 'new_forums_page' => __( 'Forums', 'buddyboss' ) ) ); } } /** Directory Display *****************************************************/ /** * Filters the loaded components needing directory page association to a WordPress page. * * @since BuddyPress 1.5.0 * * @param array $directory_pages Array of available components to set associations for. */ return apply_filters( 'bp_directory_pages', $directory_pages ); }
更新日志
版本 | 描述 |
---|---|
BuddyPress 2.4.1 | 介绍了。 |