本文整理汇总了PHP中bp_update_is_directory函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_update_is_directory函数的具体用法?PHP bp_update_is_directory怎么用?PHP bp_update_is_directory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_update_is_directory函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: groups_directory_groups_setup
/**
* Handle the display of the Groups directory index.
*
* @since 1.0.0
*/
function groups_directory_groups_setup()
{
if (bp_is_groups_directory()) {
// Set group type if available.
if (bp_is_current_action(bp_get_groups_group_type_base()) && bp_action_variable()) {
$matched_types = bp_groups_get_group_types(array('has_directory' => true, 'directory_slug' => bp_action_variable()));
// Redirect back to group directory if no match.
if (empty($matched_types)) {
bp_core_redirect(bp_get_groups_directory_permalink());
}
// Set our global variable.
buddypress()->groups->current_directory_type = reset($matched_types);
}
bp_update_is_directory(true, 'groups');
/**
* Fires before the loading of the Groups directory index.
*
* @since 1.1.0
*/
do_action('groups_directory_groups_setup');
/**
* Filters the template to load for the Groups directory index.
*
* @since 1.0.0
*
* @param string $value Path to the groups directory index template to load.
*/
bp_core_load_template(apply_filters('groups_template_directory_groups', 'groups/index'));
}
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:35,代码来源:bp-groups-screens.php
示例2: is_group
/**
* Are we looking at something that needs group theme compatibility?
*
* @since 1.7.0
*/
public function is_group()
{
// Bail if not looking at a group.
if (!bp_is_groups_component()) {
return;
}
// Group Directory.
if (!bp_current_action() && !bp_current_item()) {
bp_update_is_directory(true, 'groups');
/**
* Fires at the start of the group theme compatibility setup.
*
* @since 1.1.0
*/
do_action('groups_directory_groups_setup');
add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
// Creating a group.
} elseif (bp_is_groups_component() && bp_is_current_action('create')) {
add_filter('bp_get_buddypress_template', array($this, 'create_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'create_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'create_content'));
// Group page.
} elseif (bp_is_single_item()) {
add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'single_content'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:35,代码来源:class-bp-groups-theme-compat.php
示例3: pending_articles_screen
/**
* draft_article_screen()
*
* Sets up and displays the screen output for the sub nav item "social-articles/screen-two"
*/
function pending_articles_screen()
{
global $bp;
bp_update_is_directory(true, 'pending_articles');
do_action('pending_articles_screen');
bp_core_load_template(apply_filters('pending_articles_screen', 'members/single/articles'));
}
开发者ID:Dannypid,项目名称:Tinymce-social-articles-1.8,代码行数:12,代码来源:social-articles-screens.php
示例4: is_blogs
/**
* Are we looking at something that needs Blogs theme compatibility?
*
* @since 1.7.0
*/
public function is_blogs()
{
// Bail if not looking at a group.
if (!bp_is_blogs_component()) {
return;
}
// Bail if looking at a users sites.
if (bp_is_user()) {
return;
}
// Blog Directory.
if (is_multisite() && !bp_current_action()) {
bp_update_is_directory(true, 'blogs');
/**
* Fires if in the blog directory and BuddyPress needs Blog theme compatibility,
* before the actions and filters are added.
*
* @since 1.5.0
*/
do_action('bp_blogs_screen_index');
add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
// Create blog.
} elseif (is_user_logged_in() && bp_blog_signup_enabled()) {
add_filter('bp_get_buddypress_template', array($this, 'create_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'create_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'create_content'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:35,代码来源:class-bp-blogs-theme-compat.php
示例5: bp_activity_screen_index
/**
* Activity screen index
*
* @since 1.5.0
*
* @uses bp_displayed_user_id()
* @uses bp_is_activity_component()
* @uses bp_current_action()
* @uses bp_update_is_directory()
* @uses do_action() To call the 'bp_activity_screen_index' hook
* @uses bp_core_load_template()
* @uses apply_filters() To call the 'bp_activity_screen_index' hook
*/
function bp_activity_screen_index()
{
if (!bp_displayed_user_id() && bp_is_activity_component() && !bp_current_action()) {
bp_update_is_directory(true, 'activity');
do_action('bp_activity_screen_index');
bp_core_load_template(apply_filters('bp_activity_screen_index', 'activity/index'));
}
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:21,代码来源:bp-activity-screens.php
示例6: bp_blogs_screen_index
function bp_blogs_screen_index()
{
if (is_multisite() && bp_is_blogs_component() && !bp_current_action()) {
bp_update_is_directory(true, 'blogs');
do_action('bp_blogs_screen_index');
bp_core_load_template(apply_filters('bp_blogs_screen_index', 'blogs/index'));
}
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:8,代码来源:bp-blogs-screens.php
示例7: bp_members_screen_index
/**
* Handles the display of the members directory index
*
* @global object $bp
*
* @uses bp_is_user()
* @uses bp_is_current_component()
* @uses do_action()
* @uses bp_core_load_template()
* @uses apply_filters()
*/
function bp_members_screen_index()
{
if (!bp_is_user() && bp_is_members_component()) {
bp_update_is_directory(true, 'members');
do_action('bp_members_screen_index');
bp_core_load_template(apply_filters('bp_members_screen_index', 'members/index'));
}
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:19,代码来源:bp-members-screens.php
示例8: bp_portfolio_directory_setup
/**
* Load the index page
*/
function bp_portfolio_directory_setup()
{
if (bp_is_portfolio_component() && !bp_current_action() && !bp_current_item()) {
bp_update_is_directory(true, 'portfolio');
do_action('bp_portfolio_directory_setup');
bp_core_load_template(apply_filters('portfolio_directory_template', BP_PORTFOLIO_TEMPLATE . '/index'));
}
}
开发者ID:ncrocfer,项目名称:BP-Portfolio,代码行数:11,代码来源:bp-portfolio-screens.php
示例9: groups_directory_groups_setup
function groups_directory_groups_setup()
{
if (bp_is_groups_component() && !bp_current_action() && !bp_current_item()) {
bp_update_is_directory(true, 'groups');
do_action('groups_directory_groups_setup');
bp_core_load_template(apply_filters('groups_template_directory_groups', 'groups/index'));
}
}
开发者ID:newington,项目名称:buddypress,代码行数:8,代码来源:bp-groups-screens.php
示例10: bp_forums_directory_forums_setup
function bp_forums_directory_forums_setup()
{
global $bp;
if (bp_is_forums_component() && (!bp_current_action() || 'tag' == bp_current_action() && bp_action_variables()) && !bp_current_item()) {
if (!bp_forums_has_directory()) {
return false;
}
if (!bp_forums_is_installed_correctly()) {
bp_core_add_message(__('The forums component has not been set up yet.', 'buddypress'), 'error');
bp_core_redirect(bp_get_root_domain());
}
bp_update_is_directory(true, 'forums');
do_action('bbpress_init');
// Check to see if the user has posted a new topic from the forums page.
if (isset($_POST['submit_topic']) && bp_is_active('forums')) {
check_admin_referer('bp_forums_new_topic');
$bp->groups->current_group = groups_get_group(array('group_id' => $_POST['topic_group_id']));
if (!empty($bp->groups->current_group->id)) {
// Auto join this user if they are not yet a member of this group
if (!is_super_admin() && 'public' == $bp->groups->current_group->status && !groups_is_user_member($bp->loggedin_user->id, $bp->groups->current_group->id)) {
groups_join_group($bp->groups->current_group->id);
}
$error_message = '';
$forum_id = groups_get_groupmeta($bp->groups->current_group->id, 'forum_id');
if (!empty($forum_id)) {
if (empty($_POST['topic_title'])) {
$error_message = __('Please provide a title for your forum topic.', 'buddypress');
} else {
if (empty($_POST['topic_text'])) {
$error_message = __('Forum posts cannot be empty. Please enter some text.', 'buddypress');
}
}
if ($error_message) {
bp_core_add_message($error_message, 'error');
$redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
} else {
if (!($topic = groups_new_group_forum_topic($_POST['topic_title'], $_POST['topic_text'], $_POST['topic_tags'], $forum_id))) {
bp_core_add_message(__('There was an error when creating the topic', 'buddypress'), 'error');
$redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum';
} else {
bp_core_add_message(__('The topic was created successfully', 'buddypress'));
$redirect = bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug . '/';
}
}
bp_core_redirect($redirect);
} else {
bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
}
} else {
bp_core_add_message(__('Please pick the group forum where you would like to post this topic.', 'buddypress'), 'error');
bp_core_redirect(add_query_arg('new', '', bp_get_forums_directory_permalink()));
}
}
do_action('bp_forums_directory_forums_setup');
bp_core_load_template(apply_filters('bp_forums_template_directory_forums_setup', 'forums/index'));
}
}
开发者ID:nxtclass,项目名称:NXTClass-Plugin,代码行数:58,代码来源:bp-forums-screens.php
示例11: task_breaker_bp_projects_screen_index
/**
* [task_breaker_bp_projects_screen_index description]
* @return void
*/
function task_breaker_bp_projects_screen_index()
{
// Check if on current project directory page.
if (!bp_displayed_user_id() && bp_is_current_component('projects') && !bp_current_action()) {
bp_update_is_directory(true, 'projects');
// ... before using bp_core_load_template to ask BuddyPress
// to load the template bp-plugin (which is located in
// BP_PLUGIN_DIR . '/templates/bp-plugin.php)
bp_core_load_template(apply_filters('task_breaker_bp_projects_screen_index', 'project-loop'));
}
}
开发者ID:codehaiku,项目名称:task-breaker,代码行数:15,代码来源:project-screens.php
示例12: bp_course_directory_setup
/**
* If your component uses a top-level directory, this function will catch the requests and load
* the index page.
*
* @package BuddyPress_Template_Pack
* @since 1.6
*/
function bp_course_directory_setup()
{
if (bp_is_course_component() && !bp_current_action() && !bp_current_item()) {
// This wrapper function sets the $bp->is_directory flag to true, which help other
// content to display content properly on your directory.
bp_update_is_directory(true, BP_COURSE_SLUG);
// Add an action so that plugins can add content or modify behavior
do_action('bp_course_directory_setup');
bp_core_load_template(apply_filters('course_directory_template', 'course/index'));
}
}
开发者ID:nikitansk,项目名称:devschool,代码行数:18,代码来源:bp-course-screens.php
示例13: bp_blogs_screen_index
/**
* Load the top-level Blogs directory.
*/
function bp_blogs_screen_index()
{
if (bp_is_blogs_directory()) {
bp_update_is_directory(true, 'blogs');
/**
* Fires right before the loading of the top-level Blogs screen template file.
*
* @since 1.0.0
*/
do_action('bp_blogs_screen_index');
bp_core_load_template(apply_filters('bp_blogs_screen_index', 'blogs/index'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:16,代码来源:bp-blogs-screens.php
示例14: is_registration
/**
* Are we looking at either the registration or activation pages?
*
* @since 1.7.0
*/
public function is_registration()
{
// Bail if not looking at the registration or activation page.
if (!bp_is_register_page() && !bp_is_activation_page()) {
return;
}
// Not a directory.
bp_update_is_directory(false, 'register');
// Setup actions.
add_filter('bp_get_buddypress_template', array($this, 'template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'dummy_post'));
add_filter('bp_replace_the_content', array($this, 'dummy_content'));
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:18,代码来源:class-bp-registration-theme-compat.php
示例15: is_directory
/**
* Are we looking at Gallery or Media Directories?
*
*/
public function is_directory()
{
// Bail if not looking at the registration or activation page
if (!mpp_is_gallery_directory()) {
return;
}
bp_set_theme_compat_active(true);
buddypress()->theme_compat->use_with_current_theme = true;
// Not a directory
bp_update_is_directory(true, 'mediapress');
// Setup actions
add_filter('bp_get_buddypress_template', array($this, 'template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
}
开发者ID:markc,项目名称:mediapress,代码行数:19,代码来源:mpp-theme-compat.php
示例16: bp_activity_screen_index
/**
* Load the Activity directory.
*
* @since 1.5.0
*
* @uses bp_displayed_user_id()
* @uses bp_is_activity_component()
* @uses bp_current_action()
* @uses bp_update_is_directory()
* @uses do_action() To call the 'bp_activity_screen_index' hook.
* @uses bp_core_load_template()
* @uses apply_filters() To call the 'bp_activity_screen_index' hook.
*/
function bp_activity_screen_index()
{
if (bp_is_activity_directory()) {
bp_update_is_directory(true, 'activity');
/**
* Fires right before the loading of the Activity directory screen template file.
*
* @since 1.5.0
*/
do_action('bp_activity_screen_index');
/**
* Filters the template to load for the Activity directory screen.
*
* @since 1.5.0
*
* @param string $template Path to the activity template to load.
*/
bp_core_load_template(apply_filters('bp_activity_screen_index', 'activity/index'));
}
}
开发者ID:dcavins,项目名称:buddypress-svn,代码行数:33,代码来源:bp-activity-screens.php
示例17: groups_directory_groups_setup
/**
* Handle the display of the Groups directory index.
*
* @since 1.0.0
*/
function groups_directory_groups_setup()
{
if (bp_is_groups_directory()) {
bp_update_is_directory(true, 'groups');
/**
* Fires before the loading of the Groups directory index.
*
* @since 1.1.0
*/
do_action('groups_directory_groups_setup');
/**
* Filters the template to load for the Groups directory index.
*
* @since 1.0.0
*
* @param string $value Path to the groups directory index template to load.
*/
bp_core_load_template(apply_filters('groups_template_directory_groups', 'groups/index'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:25,代码来源:bp-groups-screens.php
示例18: is_activity
/**
* Set up the theme compatibility hooks, if we're looking at an activity page.
*
* @since 1.7.0
*/
public function is_activity()
{
// Bail if not looking at a group.
if (!bp_is_activity_component()) {
return;
}
// Activity Directory.
if (!bp_displayed_user_id() && !bp_current_action()) {
bp_update_is_directory(true, 'activity');
/** This action is documented in bp-activity/bp-activity-screens.php */
do_action('bp_activity_screen_index');
add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
// Single activity.
} elseif (bp_is_single_activity()) {
add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'single_dummy_content'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:26,代码来源:class-bp-activity-theme-compat.php
示例19: is_blogs
/**
* Are we looking at something that needs group theme compatability?
*
* @since BuddyPress (1.7)
*/
public function is_blogs()
{
// Bail if not looking at a group
if (!bp_is_blogs_component()) {
return;
}
// Bail if looking at a users sites
if (bp_is_user()) {
return;
}
// Blog Directory
if (is_multisite() && !bp_current_action()) {
bp_update_is_directory(true, 'blogs');
do_action('bp_blogs_screen_index');
add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
// Create blog
} elseif (is_user_logged_in() && bp_blog_signup_enabled()) {
add_filter('bp_get_buddypress_template', array($this, 'create_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'create_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'create_content'));
}
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:29,代码来源:bp-blogs-screens.php
示例20: is_members
/**
* Are we looking at something that needs members theme compatibility?
*
* @since 1.7.0
*/
public function is_members()
{
// Bail if not looking at the members component or a user's page.
if (!bp_is_members_component() && !bp_is_user()) {
return;
}
// Members Directory.
if (!bp_current_action() && !bp_current_item()) {
bp_update_is_directory(true, 'members');
/**
* Fires if looking at Members directory when needing theme compat.
*
* @since 1.5.0
*/
do_action('bp_members_screen_index');
add_filter('bp_get_buddypress_template', array($this, 'directory_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'directory_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'directory_content'));
// User page.
} elseif (bp_is_user()) {
// If we're on a single activity permalink page, we shouldn't use the members
// template, so stop here!
if (bp_is_active('activity') && bp_is_single_activity()) {
return;
}
/**
* Fires if looking at Members user page when needing theme compat.
*
* @since 1.5.0
*/
do_action('bp_members_screen_display_profile');
add_filter('bp_get_buddypress_template', array($this, 'single_template_hierarchy'));
add_action('bp_template_include_reset_dummy_post_data', array($this, 'single_dummy_post'));
add_filter('bp_replace_the_content', array($this, 'single_dummy_content'));
}
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:41,代码来源:class-bp-members-theme-compat.php
注:本文中的bp_update_is_directory函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论