本文整理汇总了PHP中bp_is_group_forum_topic函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_group_forum_topic函数的具体用法?PHP bp_is_group_forum_topic怎么用?PHP bp_is_group_forum_topic使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_group_forum_topic函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tk_get_bp_page_type
function tk_get_bp_page_type($page_type)
{
global $bp;
if (is_page() && tk_is_buddypress() && $bp->current_component != '') {
$slug = $bp->current_component;
$component = tk_get_bp_component_by_slug($slug);
$action = $bp->current_action;
if ($component != '') {
if ($action != '') {
if (bp_is_group_forum_topic()) {
$page_type = 'bp-component-' . $component . '-' . $action . '-topic';
} elseif (!bp_is_activity_front_page() && bp_is_activity_component() && $action != 'just-me') {
$page_type = 'bp-component-activity-activity';
} else {
$page_type = 'bp-component-' . $component . '-' . $action;
}
} else {
$page_type = 'bp-component-' . $component;
}
}
}
return apply_filters('tk_get_bp_page_type', $page_type);
}
示例2: bp_get_the_body_class
//.........这里部分代码省略.........
$bp_classes[] = 'profile-edit';
}
if (bp_is_user_friends_activity()) {
$bp_classes[] = 'friends-activity';
}
if (bp_is_user_groups_activity()) {
$bp_classes[] = 'groups-activity';
}
/* Messages **********************************************************/
if (bp_is_messages_inbox()) {
$bp_classes[] = 'inbox';
}
if (bp_is_messages_sentbox()) {
$bp_classes[] = 'sentbox';
}
if (bp_is_messages_compose_screen()) {
$bp_classes[] = 'compose';
}
if (bp_is_notices()) {
$bp_classes[] = 'notices';
}
if (bp_is_user_friend_requests()) {
$bp_classes[] = 'friend-requests';
}
if (bp_is_create_blog()) {
$bp_classes[] = 'create-blog';
}
/* Groups ************************************************************/
if (bp_is_group()) {
$bp_classes[] = 'group-' . groups_get_current_group()->slug;
// Add current group types.
if ($group_types = bp_groups_get_group_type(bp_get_current_group_id(), false)) {
foreach ($group_types as $group_type) {
$bp_classes[] = sprintf('group-type-%s', esc_attr($group_type));
}
}
}
if (bp_is_group_leave()) {
$bp_classes[] = 'leave-group';
}
if (bp_is_group_invites()) {
$bp_classes[] = 'group-invites';
}
if (bp_is_group_members()) {
$bp_classes[] = 'group-members';
}
if (bp_is_group_forum_topic()) {
$bp_classes[] = 'group-forum-topic';
}
if (bp_is_group_forum_topic_edit()) {
$bp_classes[] = 'group-forum-topic-edit';
}
if (bp_is_group_forum()) {
$bp_classes[] = 'group-forum';
}
if (bp_is_group_admin_page()) {
$bp_classes[] = 'group-admin';
$bp_classes[] = bp_get_group_current_admin_tab();
}
if (bp_is_group_create()) {
$bp_classes[] = 'group-create';
$bp_classes[] = bp_get_groups_current_create_step();
}
if (bp_is_group_home()) {
$bp_classes[] = 'group-home';
}
if (bp_is_single_activity()) {
$bp_classes[] = 'activity-permalink';
}
/* Registration ******************************************************/
if (bp_is_register_page()) {
$bp_classes[] = 'registration';
}
if (bp_is_activation_page()) {
$bp_classes[] = 'activation';
}
/* Current Component & Action ****************************************/
if (!bp_is_blog_page()) {
$bp_classes[] = bp_current_component();
$bp_classes[] = bp_current_action();
}
/* Clean up ***********************************************************/
// Add BuddyPress class if we are within a BuddyPress page.
if (!bp_is_blog_page()) {
$bp_classes[] = 'buddypress';
}
// Merge WP classes with BuddyPress classes and remove any duplicates.
$classes = array_unique(array_merge((array) $bp_classes, (array) $wp_classes));
/**
* Filters the BuddyPress classes to be added to body_class()
*
* @since 1.1.0
*
* @param array $classes Array of body classes to add.
* @param array $bp_classes Array of BuddyPress-based classes.
* @param array $wp_classes Array of WordPress-based classes.
* @param array $custom_classes Array of classes that were passed to get_body_class().
*/
return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes);
}
示例3: bp_get_the_body_class
//.........这里部分代码省略.........
}
if (bp_is_user_recent_commments()) {
$bp_classes[] = 'recent-comments';
}
if (bp_is_user_recent_posts()) {
$bp_classes[] = 'recent-posts';
}
if (bp_is_user_change_avatar()) {
$bp_classes[] = 'change-avatar';
}
if (bp_is_user_profile_edit()) {
$bp_classes[] = 'profile-edit';
}
if (bp_is_user_friends_activity()) {
$bp_classes[] = 'friends-activity';
}
if (bp_is_user_groups_activity()) {
$bp_classes[] = 'groups-activity';
}
if (is_user_logged_in()) {
$bp_classes[] = 'logged-in';
}
/** Messages **********************************************************/
if (bp_is_messages_inbox()) {
$bp_classes[] = 'inbox';
}
if (bp_is_messages_sentbox()) {
$bp_classes[] = 'sentbox';
}
if (bp_is_messages_compose_screen()) {
$bp_classes[] = 'compose';
}
if (bp_is_notices()) {
$bp_classes[] = 'notices';
}
if (bp_is_user_friend_requests()) {
$bp_classes[] = 'friend-requests';
}
if (bp_is_create_blog()) {
$bp_classes[] = 'create-blog';
}
/** Groups ************************************************************/
if (bp_is_group_leave()) {
$bp_classes[] = 'leave-group';
}
if (bp_is_group_invites()) {
$bp_classes[] = 'group-invites';
}
if (bp_is_group_members()) {
$bp_classes[] = 'group-members';
}
if (bp_is_group_forum_topic()) {
$bp_classes[] = 'group-forum-topic';
}
if (bp_is_group_forum_topic_edit()) {
$bp_classes[] = 'group-forum-topic-edit';
}
if (bp_is_group_forum()) {
$bp_classes[] = 'group-forum';
}
if (bp_is_group_admin_page()) {
$bp_classes[] = 'group-admin';
}
if (bp_is_group_create()) {
$bp_classes[] = 'group-create';
}
if (bp_is_group_home()) {
$bp_classes[] = 'group-home';
}
if (bp_is_single_activity()) {
$bp_classes[] = 'activity-permalink';
}
/** Registration ******************************************************/
if (bp_is_register_page()) {
$bp_classes[] = 'registration';
}
if (bp_is_activation_page()) {
$bp_classes[] = 'activation';
}
/** Current Component & Action ****************************************/
if (!bp_is_blog_page()) {
$bp_classes[] = bp_current_component();
$bp_classes[] = bp_current_action();
}
/** Clean up***********************************************************/
// We don't want NXTClass blog classes to appear on non-blog pages.
if (!bp_is_blog_page()) {
// Preserve any custom classes already set
if (!empty($custom_classes)) {
$nxt_classes = (array) $custom_classes;
} else {
$nxt_classes = array();
}
}
// Merge nxt classes with BP classes
$classes = array_merge((array) $bp_classes, (array) $nxt_classes);
// Remove any duplicates
$classes = array_unique($classes);
return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $nxt_classes, $custom_classes);
}
示例4: bp_group_new_topic_button
function bp_group_new_topic_button() {
if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) {
bp_button( array (
'id' => 'new_topic',
'component' => 'groups',
'must_be_logged_in' => true,
'block_self' => true,
'wrapper_class' => 'group-button',
'link_href' => '#post-new',
'link_class' => '',
'link_text' => __( 'New Topic', 'buddypress' ),
'link_title' => __( 'New Topic', 'buddypress' ),
) );
}
}
示例5: bp_get_the_topic_permalink
/**
* Return the permalink for the current topic in the loop.
*
* @since 1.0.0
*
* @return string Permalink for the current topic.
*/
function bp_get_the_topic_permalink()
{
global $forum_template;
// The topic is in a loop where its parent object is loaded.
if (bp_get_the_topic_object_slug()) {
$permalink = trailingslashit(bp_get_groups_directory_permalink() . bp_get_the_topic_object_slug() . '/forum');
// We are viewing a single group topic, so use the current item.
} elseif (bp_is_group_forum_topic()) {
$permalink = trailingslashit(bp_get_groups_directory_permalink() . bp_current_item() . '/forum');
// We are unsure what the context is, so fallback to forum root slug.
} elseif (bp_is_single_item()) {
$permalink = trailingslashit(bp_get_root_domain() . '/' . bp_get_forums_root_slug() . '/' . bp_current_item());
// This is some kind of error situation, so use forum root.
} else {
$permalink = trailingslashit(bp_get_root_domain() . '/' . bp_get_forums_root_slug());
}
/**
* Filters the permalink for the current topic in the loop.
*
* @since 1.0.0
*
* @param string $value Permalink for the current topic in the loop.
*/
return apply_filters('bp_get_the_topic_permalink', trailingslashit($permalink . 'topic/' . $forum_template->topic->topic_slug));
}
示例6: bp_get_group_new_topic_button
/**
* Returns a 'New Topic' button for a group.
*
* @since 1.2.7
*
* @param BP_Groups_Group|bool $group The BP Groups_Group object if
* passed, boolean false if not passed.
* @return string HTML code for the button.
*/
function bp_get_group_new_topic_button($group = false)
{
global $groups_template;
if (empty($group)) {
$group =& $groups_template->group;
}
if (!is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic()) {
return false;
}
$button = array('id' => 'new_topic', 'component' => 'groups', 'must_be_logged_in' => true, 'block_self' => true, 'wrapper_class' => 'group-button', 'link_href' => '#post-new', 'link_class' => 'group-button show-hide-new', 'link_id' => 'new-topic-button', 'link_text' => __('New Topic', 'buddypress'), 'link_title' => __('New Topic', 'buddypress'));
/**
* Filters the HTML button for creating a new topic in a group.
*
* @since 1.5.0
* @since 2.5.0 Added the `$group` parameter.
*
* @param string $button HTML button for a new topic.
* @param object $group Group object.
*/
return bp_get_button(apply_filters('bp_get_group_new_topic_button', $button, $group));
}
示例7: bp_get_template_part
<?php
bp_get_template_part('forums/forums-loop');
?>
</div><!-- .forums.single-forum -->
<?php
}
?>
<?php
do_action('bp_after_group_forum_content');
?>
<?php
if (!bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic()) {
?>
<?php
if (!bp_group_is_user_banned() && (is_user_logged_in() && 'public' == bp_get_group_status() || bp_group_is_member())) {
?>
<form action="" method="post" id="forum-topic-form" class="standard-form">
<div id="new-topic-post">
<?php
do_action('bp_before_group_forum_post_new');
?>
<?php
if (bp_groups_auto_join() && !bp_group_is_member()) {
示例8: bp_get_the_body_class
//.........这里部分代码省略.........
if (bp_is_user_friends()) {
$bp_classes[] = 'my-friends';
}
if (bp_is_user_messages()) {
$bp_classes[] = 'my-messages';
}
if (bp_is_user_recent_commments()) {
$bp_classes[] = 'recent-comments';
}
if (bp_is_user_recent_posts()) {
$bp_classes[] = 'recent-posts';
}
if (bp_is_user_change_avatar()) {
$bp_classes[] = 'change-avatar';
}
if (bp_is_user_profile_edit()) {
$bp_classes[] = 'profile-edit';
}
if (bp_is_user_friends_activity()) {
$bp_classes[] = 'friends-activity';
}
if (bp_is_user_groups_activity()) {
$bp_classes[] = 'groups-activity';
}
/** Messages **********************************************************/
if (bp_is_messages_inbox()) {
$bp_classes[] = 'inbox';
}
if (bp_is_messages_sentbox()) {
$bp_classes[] = 'sentbox';
}
if (bp_is_messages_compose_screen()) {
$bp_classes[] = 'compose';
}
if (bp_is_notices()) {
$bp_classes[] = 'notices';
}
if (bp_is_user_friend_requests()) {
$bp_classes[] = 'friend-requests';
}
if (bp_is_create_blog()) {
$bp_classes[] = 'create-blog';
}
/** Groups ************************************************************/
if (bp_is_group()) {
$bp_classes[] = 'group-' . groups_get_current_group()->slug;
}
if (bp_is_group_leave()) {
$bp_classes[] = 'leave-group';
}
if (bp_is_group_invites()) {
$bp_classes[] = 'group-invites';
}
if (bp_is_group_members()) {
$bp_classes[] = 'group-members';
}
if (bp_is_group_forum_topic()) {
$bp_classes[] = 'group-forum-topic';
}
if (bp_is_group_forum_topic_edit()) {
$bp_classes[] = 'group-forum-topic-edit';
}
if (bp_is_group_forum()) {
$bp_classes[] = 'group-forum';
}
if (bp_is_group_admin_page()) {
$bp_classes[] = 'group-admin';
$bp_classes[] = bp_get_group_current_admin_tab();
}
if (bp_is_group_create()) {
$bp_classes[] = 'group-create';
$bp_classes[] = bp_get_groups_current_create_step();
}
if (bp_is_group_home()) {
$bp_classes[] = 'group-home';
}
if (bp_is_single_activity()) {
$bp_classes[] = 'activity-permalink';
}
/** Registration ******************************************************/
if (bp_is_register_page()) {
$bp_classes[] = 'registration';
}
if (bp_is_activation_page()) {
$bp_classes[] = 'activation';
}
/** Current Component & Action ****************************************/
if (!bp_is_blog_page()) {
$bp_classes[] = bp_current_component();
$bp_classes[] = bp_current_action();
}
/** Clean up ***********************************************************/
// Add BuddyPress class if we are within a BuddyPress page
if (!bp_is_blog_page()) {
$bp_classes[] = 'buddypress';
}
// Merge WP classes with BuddyPress classes and remove any duplicates
$classes = array_unique(array_merge((array) $bp_classes, (array) $wp_classes));
return apply_filters('bp_get_the_body_class', $classes, $bp_classes, $wp_classes, $custom_classes);
}
示例9: cbox_fix_bbp_new_topic_button
/**
* Temporarily fix the "New Topic" button when using bbPress with BP.
*
* @todo Remove this when bbPress addresses this.
*/
function cbox_fix_bbp_new_topic_button()
{
// if groups isn't active, stop now!
if (!bp_is_active('groups')) {
return;
}
// if bbPress 2 isn't enabled, stop now!
if (!function_exists('bbpress')) {
return;
}
// remove the 'New Topic' button
// this is done because the 'bp_get_group_new_topic_button' filter doesn't
// work properly
remove_action('bp_group_header_actions', 'bp_group_new_topic_button');
// version of bp_is_group_forum() that works with bbPress 2
$is_group_forum = bp_is_single_item() && bp_is_groups_component() && bp_is_current_action('forum');
// If these conditions are met, this button should not be displayed
if (!is_user_logged_in() || !$is_group_forum || bp_is_group_forum_topic() || bp_group_is_user_banned()) {
return false;
}
// create function to output new topic button
$new_button = create_function('', "\n\t\t// do not show in sidebar\n\t\tif ( did_action( 'open_sidebar' ) )\n\t\t\treturn;\n\n\t\t// render the button\n\t\tbp_button( array(\n\t\t\t'id' => 'new_topic',\n\t\t\t'component' => 'groups',\n\t\t\t'must_be_logged_in' => true,\n\t\t\t'block_self' => true,\n\t\t\t'wrapper_class' => 'group-button',\n\t\t\t'link_href' => '#new-post', // anchor modified\n\t\t\t'link_class' => 'group-button', // removed a link_class here\n\t\t\t'link_id' => 'new-topic-button',\n\t\t\t'link_text' => __( 'New Topic', 'buddypress' ),\n\t\t\t'link_title' => __( 'New Topic', 'buddypress' ),\n\t\t) );\n\t");
// add our customized 'New Topic' button
add_action('bp_group_header_actions', $new_button);
}
示例10: ac_notifier_remove_notification_for_topic
/**
* @since 1.0.3
* it is not used any more because qwe are linking to threaded view
* Remove notification for group forum posts/new topic
*/
function ac_notifier_remove_notification_for_topic()
{
global $bp;
//is group & group forum active ?
if (!(bp_is_active("groups") && bp_is_active("forums"))) {
return;
}
//if either group or forum is not actuive do not do anything
//check if we are on single topic screen, right?
if (bp_is_group_forum_topic() && is_user_logged_in()) {
$topic_id = bp_forums_get_topic_id_from_slug($bp->action_variables[1]);
//get id from slug
$topic = get_topic($topic_id);
$group_id = $bp->groups->current_group->id;
//find activity id for this topic
$activity_id = bp_activity_get_activity_id(array('user_id' => $topic->poster_id, 'component' => $bp->groups->id, 'type' => "new_forum_topic", "item_id" => $group_id, 'secondary_item_id' => $topic_id));
//remove notification for new topic comments: easy
if (!empty($activity_id)) {
bp_core_delete_notifications_by_item_id($bp->loggedin_user->id, $activity_id, $bp->ac_notifier->id, 'new_activity_comment_' . $activity_id);
}
$posts = ac_notifier_get_forum_post_ids($topic_id);
if (!empty($posts)) {
//find all activities for the post
$activities = ac_notifier_get_activity_ids(array("item_id" => $group_id, "secondary_ids" => $posts, "component" => $bp->groups->id, "type" => "new_forum_post"));
//pass the array
foreach ((array) $activities as $ac_id) {
bp_core_delete_notifications_by_item_id($bp->loggedin_user->id, $ac_id, $bp->ac_notifier->id, 'new_activity_comment_' . $ac_id);
}
}
}
}
示例11: body_class
function body_class($wp_classes, $custom_classes = false)
{
global $bp;
$bp_classes = array();
if (bp_is_directory()) {
$bp_classes[] = 'directory';
} elseif (bp_is_single_item()) {
$bp_classes[] = 'single-item';
} elseif (bp_is_activity_component() || $this->show_activity_page) {
$bp_classes[] = 'activity';
}
if ($this->adminbar && $this->theme->have_adminbar()) {
$bp_classes[] = 'adminbar';
}
if (!is_page() && is_front_page() && is_file(CHILD_DIR . '/home.php')) {
$bp_classes[] = 'home';
}
if ($this->show_activity_page) {
$bp_classes[] = 'internal-page';
} elseif (!bp_is_blog_page()) {
$wp_classes = array();
if (!bp_is_directory()) {
$bp_classes[] = 'internal-page';
}
if (bp_is_user_profile()) {
$bp_classes[] = 'profile';
} elseif (bp_is_blogs_component()) {
$bp_classes[] = 'blogs';
} elseif (bp_is_messages_component()) {
$bp_classes[] = 'messages';
} elseif (bp_is_friends_component()) {
$bp_classes[] = 'friends';
} elseif (bp_is_groups_component()) {
$bp_classes[] = 'groups';
} elseif (bp_is_settings_component()) {
$bp_classes[] = 'settings';
}
}
if (is_user_logged_in()) {
$bp_classes[] = 'logged-in';
if (!bp_is_directory()) {
if (bp_is_user_friends()) {
$bp_classes[] = 'my-friends';
} elseif (bp_is_user_activity()) {
$bp_classes[] = 'my-activity';
} elseif (bp_is_user_blogs()) {
$bp_classes[] = 'my-blogs';
} elseif (bp_is_user_groups()) {
$bp_classes[] = 'my-groups';
} elseif (bp_is_messages_inbox()) {
$bp_classes[] = 'inbox';
} elseif (bp_is_messages_sentbox()) {
$bp_classes[] = 'sentbox';
} elseif (bp_is_messages_compose_screen()) {
$bp_classes[] = 'compose';
} elseif (bp_is_notices()) {
$bp_classes[] = 'notices';
} elseif (bp_is_user_friend_requests()) {
$bp_classes[] = 'friend-requests';
} elseif (bp_is_create_blog()) {
$bp_classes[] = 'create-blog';
} elseif (bp_is_group_leave()) {
$bp_classes[] = 'leave-group';
} elseif (bp_is_group_invites()) {
$bp_classes[] = 'group-invites';
} elseif (bp_is_group_forum_topic_edit()) {
$bp_classes[] = 'group-forum-topic-edit';
} elseif (bp_is_group_admin_page()) {
$bp_classes[] = 'group-admin';
} elseif (bp_is_group_create()) {
$bp_classes[] = 'group-create';
} elseif (bp_is_user_change_avatar()) {
$bp_classes[] = 'change-avatar';
} elseif (bp_is_user_profile_edit()) {
$bp_classes[] = 'profile-edit';
}
}
} else {
$bp_classes[] = 'visitor';
}
if (bp_is_group_members()) {
$bp_classes[] = 'group-members';
} elseif (bp_is_group_home()) {
$bp_classes[] = 'group-home';
} elseif (bp_is_group_forum()) {
$bp_classes[] = 'group-forum';
if (bp_is_group_forum_topic()) {
$bp_classes[] = 'group-forum-topic';
}
} else {
if (bp_is_user_recent_commments()) {
$bp_classes[] = 'recent-comments';
}
if (bp_is_user_recent_posts()) {
$bp_classes[] = 'recent-posts';
}
if (bp_is_user_friends_activity()) {
$bp_classes[] = 'friends-activity';
} elseif (bp_is_single_activity()) {
$bp_classes[] = 'activity-permalink';
//.........这里部分代码省略.........
示例12: gconnect_locate_template
?>
</select>
</li>
</ul>
<div class="clear"></div>
</div>
<div class="forums single-forum" role="main">
<?php
gconnect_locate_template(array('forums/forums-loop.php'), true);
?>
</div><!-- .forums.single-forum -->
<?php
}
do_action('bp_after_group_forum_content');
if (!bp_is_group_forum_topic_edit() && !bp_is_group_forum_topic() && !bp_group_is_user_banned() && (is_user_logged_in() && 'public' == bp_get_group_status() || bp_group_is_member())) {
?>
<form action="" method="post" id="forum-topic-form" class="standard-form">
<div id="new-topic-post">
<?php
do_action('bp_before_group_forum_post_new');
?>
<?php
if (bp_groups_auto_join() && !bp_group_is_member()) {
?>
<p><?php
_e('You will auto join this group when you start a new topic.', 'buddypress');
?>
示例13: shoestrap_is_bp
/**
* Check if this is a BuddyPress page or not.
* Returns true or false (boolean)
*/
function shoestrap_is_bp()
{
$bp = false;
/** Pages *************************************************************/
if (!$bp && bp_is_directory()) {
$bp = true;
} elseif (!$bp && bp_is_single_item()) {
$bp = true;
} elseif (!$bp && bp_is_user_profile()) {
$bp = true;
} elseif (!$bp && bp_is_activity_component()) {
$bp = true;
} elseif (!$bp && bp_is_blogs_component()) {
$bp = true;
} elseif (!$bp && bp_is_messages_component()) {
$bp = true;
} elseif (!$bp && bp_is_friends_component()) {
$bp = true;
} elseif (!$bp && bp_is_groups_component()) {
$bp = true;
} elseif (!$bp && bp_is_settings_component()) {
$bp = true;
} elseif (!$bp && bp_is_user()) {
$bp = true;
} elseif (!$bp && bp_is_user_blogs()) {
$bp = true;
} elseif (!$bp && bp_is_user_groups()) {
$bp = true;
} elseif (!$bp && bp_is_user_activity()) {
$bp = true;
} elseif (!$bp && bp_is_my_profile()) {
$bp = true;
} elseif (!$bp && bp_is_user_profile()) {
$bp = true;
} elseif (!$bp && bp_is_user_friends()) {
$bp = true;
} elseif (!$bp && bp_is_user_messages()) {
$bp = true;
} elseif (!$bp && bp_is_user_recent_commments()) {
$bp = true;
} elseif (!$bp && bp_is_user_recent_posts()) {
$bp = true;
} elseif (!$bp && bp_is_user_change_avatar()) {
$bp = true;
} elseif (!$bp && bp_is_user_profile_edit()) {
$bp = true;
} elseif (!$bp && bp_is_user_friends_activity()) {
$bp = true;
} elseif (!$bp && bp_is_user_groups_activity()) {
$bp = true;
} elseif (!$bp && is_user_logged_in()) {
$bp = true;
} elseif (!$bp && bp_is_messages_inbox()) {
$bp = true;
} elseif (!$bp && bp_is_messages_sentbox()) {
$bp = true;
} elseif (!$bp && bp_is_messages_compose_screen()) {
$bp = true;
} elseif (!$bp && bp_is_notices()) {
$bp = true;
} elseif (!$bp && bp_is_user_friend_requests()) {
$bp = true;
} elseif (!$bp && bp_is_create_blog()) {
$bp = true;
} elseif (!$bp && bp_is_group_leave()) {
$bp = true;
} elseif (!$bp && bp_is_group_invites()) {
$bp = true;
} elseif (!$bp && bp_is_group_members()) {
$bp = true;
} elseif (!$bp && bp_is_group_forum_topic()) {
$bp = true;
} elseif (!$bp && bp_is_group_forum_topic_edit()) {
$bp = true;
} elseif (!$bp && bp_is_group_forum()) {
$bp = true;
} elseif (!$bp && bp_is_group_admin_page()) {
$bp = true;
} elseif (!$bp && bp_is_group_create()) {
$bp = true;
} elseif (!$bp && bp_is_group_home()) {
$bp = true;
} elseif (!$bp && bp_is_single_activity()) {
$bp = true;
} elseif (!$bp && bp_is_register_page()) {
$bp = true;
} elseif (!$bp && bp_is_activation_page()) {
$bp = true;
} elseif (!$bp && !bp_is_blog_page()) {
$bp = true;
}
return $bp;
}
示例14: suffusion_bp_content_class
/**
* Similar to the post_class() function, but for BP. This is NOT used by core Suffusion, but is useful for child themes using BP.
* This might be defined by the Suffusion BuddyPress Pack for BP users of Suffusion, but is included conditionally here so
* that the theme and the plugin can be used independently of each other and so that one version of Suffusion can work with an older
* version of the BP pack.
*
* @since 3.6.7
* @param bool $custom
* @param bool $echo
* @return bool|string
*/
function suffusion_bp_content_class($custom = false, $echo = true)
{
if (!function_exists('bp_is_group')) {
return false;
}
$css = array();
$css[] = 'post';
if (function_exists('bp_is_profile_component') && bp_is_profile_component()) {
$css[] = 'profile-component';
}
if (function_exists('bp_is_activity_component') && bp_is_activity_component()) {
$css[] = 'activity-component';
}
if (function_exists('bp_is_blogs_component') && bp_is_blogs_component()) {
$css[] = 'blogs-component';
}
if (function_exists('bp_is_messages_component') && bp_is_messages_component()) {
$css[] = 'messages-component';
}
if (function_exists('bp_is_friends_component') && bp_is_friends_component()) {
$css[] = 'friends-component';
}
if (function_exists('bp_is_groups_component') && bp_is_groups_component()) {
$css[] = 'groups-component';
}
if (function_exists('bp_is_settings_component') && bp_is_settings_component()) {
$css[] = 'settings-component';
}
if (function_exists('bp_is_member') && bp_is_member()) {
$css[] = 'member';
}
if (function_exists('bp_is_user_activity') && bp_is_user_activity()) {
$css[] = 'user-activity';
}
if (function_exists('bp_is_user_friends_activity') && bp_is_user_friends_activity()) {
$css[] = 'user-friends-activity';
}
if (function_exists('bp_is_activity_permalink') && bp_is_activity_permalink()) {
$css[] = 'activity-permalink';
}
if (function_exists('bp_is_user_profile') && bp_is_user_profile()) {
$css[] = 'user-profile';
}
if (function_exists('bp_is_profile_edit') && bp_is_profile_edit()) {
$css[] = 'profile-edit';
}
if (function_exists('bp_is_change_avatar') && bp_is_change_avatar()) {
$css[] = 'change-avatar';
}
if (function_exists('bp_is_user_groups') && bp_is_user_groups()) {
$css[] = 'user-groups';
}
if (function_exists('bp_is_group') && bp_is_group()) {
$css[] = 'group';
}
if (function_exists('bp_is_group_home') && bp_is_group_home()) {
$css[] = 'group-home';
}
if (function_exists('bp_is_group_create') && bp_is_group_create()) {
$css[] = 'group-create';
}
if (function_exists('bp_is_group_admin_page') && bp_is_group_admin_page()) {
$css[] = 'group-admin-page';
}
if (function_exists('bp_is_group_forum') && bp_is_group_forum()) {
$css[] = 'group-forum';
}
if (function_exists('bp_is_group_activity') && bp_is_group_activity()) {
$css[] = 'group-activity';
}
if (function_exists('bp_is_group_forum_topic') && bp_is_group_forum_topic()) {
$css[] = 'group-forum-topic';
}
if (function_exists('bp_is_group_forum_topic_edit') && bp_is_group_forum_topic_edit()) {
$css[] = 'group-forum-topic-edit';
}
if (function_exists('bp_is_group_members') && bp_is_group_members()) {
$css[] = 'group-members';
}
if (function_exists('bp_is_group_invites') && bp_is_group_invites()) {
$css[] = 'group-invites';
}
if (function_exists('bp_is_group_membership_request') && bp_is_group_membership_request()) {
$css[] = 'group-membership-request';
}
if (function_exists('bp_is_group_leave') && bp_is_group_leave()) {
$css[] = 'group-leave';
}
if (function_exists('bp_is_group_single') && bp_is_group_single()) {
//.........这里部分代码省略.........
示例15: tk_get_bp_page_type
function tk_get_bp_page_type($page_type)
{
global $bp;
if (is_page() && $this->tk_is_buddypress() && $bp->current_component != '') {
$slug = $bp->current_component;
$action = $bp->current_action;
if (isset($bp) && property_exists($bp, 'displayed_user') && property_exists($bp->displayed_user, 'id') && $bp->displayed_user->id != 0 && $slug == 'activity' && $action == 'just-me') {
$slug = 'profile';
}
$component = $this->tk_get_bp_component_by_slug($slug);
if ($component != '') {
if ($action != '') {
if (bp_is_group_forum_topic()) {
$page_type = 'bp-component-' . $component . '-' . $action . '-topic';
} elseif (!bp_is_component_front_page('activity') && bp_is_activity_component() && $action != 'just-me') {
$page_type = 'bp-component-activity-activity';
} else {
$page_type = 'bp-component-' . $component . '-' . $action;
}
} else {
$page_type = 'bp-component-' . $component;
}
}
}
return apply_filters('tk_get_bp_page_type', $page_type);
}