bp_ps_directories ()
返回BuddyBoss配置文件搜索目录数组。
描述
源
文件:bp-core /概要搜索/ bps-directory.php
函数bp_ps_directories () {static $dirs = array ();If (count ($dirs))返回$dirs;$bp_pages = bp_core_get_directory_page_ids ();If (isset ($bp_pages['members']) {$members = $bp_pages['members'];$dirs[$members] = new stdClass;$dirs[$members]->label = get_the_title ($members);$dirs[$members]->link = parse_url (get_page_link ($members), PHP_URL_PATH);$member_types = bp_get_member_types (array (), 'objects');foreach ($member_types as $type) if ($type->has_directory == 1) {$dirs[$type->name] = new stdClass;dirs美元[$类型- >名称]- >标签= $ dirs[$成员]- >标签。 ' - '. $type->labels['name']; $dirs[$type->name]->link = parse_url (bp_get_member_type_directory_permalink ($type->name), PHP_URL_PATH); } } if (!shortcode_exists ('bp_ps_directory')) return $dirs; $pages = get_pages (); foreach ($pages as $page) if (has_shortcode ($page->post_content, 'bp_ps_directory')) { $dirs[$page->ID] = new stdClass; $dirs[$page->ID]->label = $page->post_title; $dirs[$page->ID]->link = parse_url (get_page_link ($page->ID), PHP_URL_PATH); } return $dirs; }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.0.0 | 介绍了。 |