bp_search_result_page_dummy_post_load (混合美元的模板)
为wp本地搜索结果加载虚拟的帖子。魅力从这里开始。
描述
参数
- 美元的模板
-
(混合)(必需)
返回
(混合)
源
文件:bp-search / bp-search-filters.php
函数bp_search_result_page_dummy_post_load($template) {global $wp_query;如果(!Bp_search_is_search()){//取消如果不搜索页面。返回$模板;} $假=阵列(“ID”= > 0,“post_status”= >“公众”,“post_author”= > 0,' post_parent ' = > 0, ' post_type ' = > '页',' post_date ' = > 0, ' post_date_gmt ' = > 0, ' post_modified ' = > 0, ' post_modified_gmt ' = > 0, post_content ' => '', ' post_title ' => '', ' post_excerpt ' => '', ' post_content_filtered ' => '', ' post_mime_type ' => '', ' post_password ' = >”,“post_name ' => '', ' guid ' => '', ' menu_order = > 0,点击 ' => '', ' to_ping ' => '', ' ping_status ' => '', ' comment_status ' = > '关闭',' comment_count ' = > 0,过滤器' = > '生”、“is_404 ' = > false, is_page ' = > false, is_single ' = > false, is_archive ' = > false, is_tax”= >假,“is_search”= > true,);//设置$post全局变量$post = new WP_Post((object) $dummy);$wp_query->post = $post;$wp_query->posts = array($post);wp_query - > post_count = 1; $wp_query->max_num_pages = 0; return $template; }
更新日志
版本 | 描述 |
---|---|
BuddyBoss 1.0.0 | 介绍了。 |