本文整理汇总了PHP中bp_is_group_home函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_group_home函数的具体用法?PHP bp_is_group_home怎么用?PHP bp_is_group_home使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_group_home函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: register_plugin_scripts
function register_plugin_scripts()
{
if (bp_is_activity_component() || bp_is_group_home()) {
wp_enqueue_script('bp-reshare-js', BP_RESHARE_PLUGIN_URL_JS . '/reshare.js', array('jquery'), 0, 1);
BP_Reshare::localize_script();
}
}
示例2: bp_checkins_is_activity_or_friends
function bp_checkins_is_activity_or_friends()
{
if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component'))) {
return false;
}
if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && bp_is_activity_component() && !bp_is_single_activity()) {
return false;
}
if ((int) bp_get_option('bp-checkins-disable-activity-checkins') && bp_is_group_home()) {
return false;
}
if (!bp_checkins_show_friends_checkins() && bp_displayed_user_id() && bp_is_friends_component()) {
return false;
}
if (bp_is_group_home() || bp_is_activity_component() || bp_displayed_user_id() && bp_is_friends_component()) {
return true;
} else {
return false;
}
}
示例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: dropdown_filters
/**
* Fake post type activities in order to add custom options
* to BuddyPress activity dropdowns
*
* Make sure the Groups/blogs activity actions appears as one component > IdeaStream
* in the Activity Administration screen.
*
* @package WP Idea Stream
* @subpackage buddypress/activity
*
* @since 2.1.0
*
* @uses buddypress() to get BuddyPress main instance
* @return array new tracking args
*/
public function dropdown_filters($tracking_args)
{
if (!isset($tracking_args['new_' . $this->post_type])) {
return;
}
if (is_admin() && function_exists('get_current_screen')) {
$current_screen = get_current_screen();
if (!empty($current_screen->id) && strpos('toplevel_page_bp-activity', $current_screen->id) !== false) {
$component = buddypress()->ideastream->id;
}
}
if (empty($component) && !bp_is_activity_directory() && !bp_is_user_activity() && !bp_is_group_home()) {
return $tracking_args;
}
$position = 50;
foreach ($this->activity_actions as $key_action => $action) {
if ('new_' . $this->post_type == $key_action) {
if (!empty($component)) {
$tracking_args[$key_action]->component_id = $component;
}
continue;
}
$position += 1;
$tracking_args[$key_action] = new stdClass();
$tracking_args[$key_action]->component_id = !empty($component) ? $component : $action->component;
$tracking_args[$key_action]->action_id = $action->type;
$tracking_args[$key_action]->admin_filter = $action->admin_caption;
$tracking_args[$key_action]->front_filter = $action->front_caption;
$tracking_args[$key_action]->contexts = $action->contexts;
$tracking_args[$key_action]->activity_comment = false;
$tracking_args[$key_action]->format_callback = $action->action_callback;
$tracking_args[$key_action]->position = $position;
}
/**
* Used internally to disallow activity dropdowns on groups not supporting ideastream
*/
return apply_filters('wp_idea_stream_buddypress_activity_filters', $tracking_args);
}
示例5: _e
<input type="submit" name="aw-whats-new-submit" id="aw-whats-new-submit" value="<?php _e( 'Post Update', 'buddypress' ) ?>" />
</div>
<?php if ( function_exists('bp_has_groups') && !bp_is_my_profile() && !bp_is_group() ) : ?>
<div id="whats-new-post-in-box">
<?php _e( 'Post in', 'buddypress' ) ?>:
<select id="whats-new-post-in" name="whats-new-post-in">
<option selected="selected" value="0"><?php _e( 'My Profile', 'buddypress' ) ?></option>
<?php if ( bp_has_groups( 'user_id=' . bp_loggedin_user_id() . '&type=alphabetical&max=100&per_page=100&populate_extras=0' ) ) : while ( bp_groups() ) : bp_the_group(); ?>
<option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option>
<?php endwhile; endif; ?>
</select>
</div>
<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
<?php elseif ( bp_is_group_home() ) : ?>
<input type="hidden" id="whats-new-post-object" name="whats-new-post-object" value="groups" />
<input type="hidden" id="whats-new-post-in" name="whats-new-post-in" value="<?php bp_group_id() ?>" />
<?php endif; ?>
<?php do_action( 'bp_activity_post_form_options' ) ?>
</div><!-- #whats-new-options -->
</div><!-- #whats-new-content -->
<?php wp_nonce_field( 'post_update', '_wpnonce_post_update' ); ?>
<?php do_action( 'bp_after_activity_post_form' ) ?>
</form><!-- #whats-new-form -->
示例6: miss_is_bp
/**
*
*/
function miss_is_bp()
{
if (function_exists('bp_is_group') && (bp_is_blog_page() || bp_is_my_profile() || bp_is_my_profile() || is_front_page() || bp_is_component_front_page('activity') || bp_is_directory() || bp_is_profile_component() || bp_is_activity_component() || bp_is_blogs_component() || bp_is_messages_component() || bp_is_friends_component() || bp_is_groups_component() || bp_is_settings_component() || bp_is_user_activity() || bp_is_user_friends_activity() || bp_is_activity_permalink() || bp_is_user_profile() || bp_is_profile_edit() || bp_is_change_avatar() || bp_is_user_groups() || bp_is_group() || bp_is_group_home() || bp_is_group_create() || bp_is_group_admin_page() || bp_is_group_forum() || bp_is_group_activity() || bp_is_group_forum_topic() || bp_is_group_forum_topic_edit() || bp_is_group_members() || bp_is_group_invites() || bp_is_group_membership_request() || bp_is_group_leave() || bp_is_group_single() || bp_is_user_blogs() || bp_is_user_recent_posts() || bp_is_user_recent_commments() || bp_is_create_blog() || bp_is_user_friends() || bp_is_friend_requests() || bp_is_user_messages() || bp_is_messages_inbox() || bp_is_messages_sentbox() || bp_is_notices() || bp_is_messages_compose_screen() || bp_is_activation_page() || bp_is_register_page())) {
return true;
}
return false;
}
示例7: 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()) {
//.........这里部分代码省略.........
示例8: 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);
}
示例9: 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';
//.........这里部分代码省略.........
示例10: do_action
?>
<div id="item-body">
<?php
do_action('bp_before_group_body');
if (bp_is_group_admin_page() && bp_group_is_visible()) {
locate_template(array('groups/single/admin.php'), true);
} elseif (bp_is_group_members() && bp_group_is_visible()) {
locate_template(array('groups/single/members.php'), true);
} elseif (bp_is_group_invites() && bp_group_is_visible()) {
locate_template(array('groups/single/send-invites.php'), true);
} elseif (bp_is_group_forum() && bp_group_is_visible() && bp_is_active('forums') && bp_forums_is_installed_correctly()) {
locate_template(array('groups/single/forum.php'), true);
} elseif (bp_is_group_membership_request()) {
locate_template(array('groups/single/request-membership.php'), true);
} elseif (bp_group_is_visible() && bp_is_group_home()) {
locate_template(array('groups/single/activity.php'), true);
} elseif (bp_group_is_visible()) {
locate_template(array('groups/single/front.php'), true);
} elseif (!bp_group_is_visible()) {
// The group is not visible, show the status message
do_action('bp_before_group_status_message');
?>
<div id="message" class="info">
<p><?php
bp_group_status_message();
?>
</p>
</div>
示例11: 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;
}
示例12: generate_activity_stream
public function generate_activity_stream($atts, $content = null)
{
//allow to use all those args awesome!
$atts = shortcode_atts(array('title' => 'Latest Activity', 'pagination' => 'true', 'display_comments' => 'threaded', 'include' => false, 'exclude' => false, 'in' => false, 'sort' => 'DESC', 'page' => 1, 'per_page' => 5, 'max' => false, 'scope' => false, 'user_id' => false, 'object' => false, 'action' => false, 'primary_id' => false, 'secondary_id' => false, 'search_terms' => false, 'use_compat' => bp_use_theme_compat_with_current_theme(), 'allow_posting' => false), $atts);
extract($atts);
//hide on user activity, activity directory and group activity
if (is_user_logged_in() && (function_exists('bp_is_activity_component') && bp_is_activity_component() || function_exists('bp_is_group_home') && bp_is_group_home())) {
return '';
}
ob_start();
?>
<?php
if ($use_compat) {
?>
<div id="buddypress">
<?php
}
?>
<?php
if ($title) {
?>
<h3 class="activity-shortcode-title"><?php
echo $title;
?>
</h3>
<?php
}
?>
<?php
do_action('bp_before_activity_loop');
?>
<?php
if ($allow_posting && is_user_logged_in()) {
?>
<?php
bp_locate_template(array('activity/post-form.php'), true);
?>
<?php
}
?>
<?php
if (bp_has_activities($atts)) {
?>
<div class="activity <?php
if (!$display_comments) {
?>
hide-activity-comments<?php
}
?>
shortcode-activity-stream">
<?php
if (empty($_POST['page'])) {
?>
<ul id="activity-stream" class="activity-list item-list">
<?php
}
?>
<?php
while (bp_activities()) {
bp_the_activity();
?>
<?php
bp_get_template_part('activity/entry');
?>
<?php
}
?>
<?php
if (empty($_POST['page'])) {
?>
</ul>
<?php
}
?>
<?php
if ($pagination) {
?>
<div class="pagination">
<div class="pag-count"><?php
bp_activity_pagination_count();
?>
</div>
<div class="pagination-links"><?php
bp_activity_pagination_links();
//.........这里部分代码省略.........
示例13: buddyboss_body_class
/**
* Extends the default WordPress body classes.
*
* @since Boss 1.0.0
*
* @param array Existing class values.
* @return array Filtered class values.
*/
function buddyboss_body_class($classes)
{
global $wp_customize;
if (!empty($wp_customize)) {
$classes[] = 'wp-customizer';
}
if (!is_multi_author()) {
$classes[] = 'single-author';
}
if (current_user_can('manage_options')) {
$classes[] = 'role-admin';
}
if (bp_is_user_activity() || bp_is_group_home() && bp_is_active('activity') || bp_is_group_activity() || bp_is_current_component('activity')) {
$classes[] = 'has-activity';
}
return array_unique($classes);
}
示例14: cssjs
/**
* Enqueues the js and css files only if BP Reshare needs it
*
* @package BP Reshare
* @since 1.0
*
* @uses bp_is_active() to check if the plugin's component is active
* @uses bp_is_activity_component() to check if we are in the Activity component area
* @uses bp_is_group_home() to check if we are in a group home
* @uses wp_enqueue_style() to safely add our style to WordPress queue
* @uses wp_enqueue_script() to safely add our script to WordPress queue
* @uses wp_localize_script() to attach some vars to it
* @uses buddyreshare_js_vars() to get the js vars for the plugin
*/
public function cssjs()
{
if (!bp_is_active($this->component_id)) {
return;
}
if (bp_is_activity_component() || bp_is_active('groups') && bp_is_group_home()) {
// CSS is Theme's territory, so let's help him to easily override our css.
$css_datas = (array) $this->css_datas();
wp_enqueue_style($css_datas['handle'], $css_datas['location'], false, $this->version);
wp_enqueue_script('bp-reshare-js', $this->plugin_js . 'reshare.js', array('jquery'), $this->version, true);
wp_localize_script('bp-reshare-js', 'bp_reshare_vars', buddyreshare_js_vars());
}
}
示例15: get_context
/**
* Get the page context
* @version 2.0
*/
function get_context()
{
// Setup placeholders
$title = SITENAME;
$desc = get_bloginfo('description');
$classes = get_body_class();
$crumbs = array();
// Get some data
$id = $this->queried_object_id;
$object = $this->queried_object;
$sep = " • ";
/*--------------------------------------------
DEFAULT CONTEXT
---------------------------------------------*/
$classes[] = 0 == get_current_user_id() ? 'logged-out' : 'logged-in';
$crumbs[] = '<a href="' . SITEURL . '" title="' . SITENAME . '" rel="home" class="trail-home">Home</a>';
// Homepage
if (is_home()) {
$title = SITENAME . $sep . 'Home';
$classes[] = 'home';
$classes[] = 'sidebar';
$classes[] = 'archive';
/*--------------------------------------------
BUDDYPRESS CONTEXT
---------------------------------------------*/
} elseif (class_exists('BuddyPress') && is_buddypress()) {
// BuddyPress Defaults
$title = "BuddyPress Page";
$desc = "This is a BuddyPress page.";
$classes[] = 'buddypress';
// User Profiles
if (bp_is_user()) {
$title = bp_get_displayed_user_fullname() . $sep . "User Profile";
$desc = SITENAME . " user profile for member " . bp_get_displayed_user_fullname();
// Your own profile
if (bp_is_my_profile()) {
$crumbs[] = 'Your Profile';
} else {
$crumbs[] = '<a href="' . bp_get_members_directory_permalink() . '" title="Members Directory">Members</a>';
$crumbs[] = '<a href="' . bp_displayed_user_domain() . '" title="' . bp_get_displayed_user_fullname() . '">' . bp_get_displayed_user_fullname() . '</a>';
}
// Display the profile component if it isnt the profile home
if (!bp_is_user_profile()) {
$crumbs[] = ucfirst(bp_current_component());
}
// Display the current action if it is not the default public profile
if (!in_array(bp_current_action(), array('public', 'just-me', 'my-friends'))) {
$crumbs[] = ucfirst(bp_current_action());
}
// Single Group
} elseif (bp_is_group() || bp_is_group_create()) {
// Group Creation
if (bp_is_group_create()) {
$title = 'Submit New Group';
$desc = 'Submit a new user group for listing on the ' . SITENAME . ' community groups directory.';
$crumbs[] = '<a href="' . SITEURL . '/' . bp_get_groups_root_slug() . '" title="Groups Directory">Groups</a>';
$crumbs[] = 'Create Group';
} elseif (bp_is_group()) {
// Default entries
$title = bp_get_group_name();
$desc = SITENAME . ' guild profile for ' . bp_get_group_name();
$classes = array_diff($classes, array('page', 'page-template-default'));
$crumbs[] = '<a href="' . bp_get_groups_directory_permalink() . '" title="Groups Directory">Groups</a>';
// Group Profile Home
if (bp_is_group_home()) {
$title = $title . $sep . 'Profile';
$crumbs[] = bp_get_group_name();
// Advanced Component
} else {
// Link back to group profile
$crumbs[] = '<a href="' . bp_get_group_permalink() . '" title="Return to Group Profile">' . bp_get_group_name() . '</a>';
// Members
if (bp_is_group_members()) {
$title = $title . $sep . 'Members';
$crumbs[] = 'Members';
// Activity
} elseif (bp_is_group_activity()) {
$title = $title . $sep . 'Activity';
$crumbs[] = 'Activity';
// Invites
} elseif (bp_is_group_invites()) {
$title = $title . $sep . 'Invitations';
$crumbs[] = 'Invitations';
// Admin
} elseif (bp_is_group_admin_page()) {
$title = $title . $sep . 'Admin';
$crumbs[] = 'Admin';
// Forum
} else {
// Forum Root
if (NULL == bp_action_variable()) {
$title = $title . $sep . 'Forum';
$crumbs[] = 'Forum';
// Sub-Component
} else {
$crumbs[] = '<a href="' . bp_get_group_permalink() . 'forum/" title="Group Forum">Forum</a>';
//.........这里部分代码省略.........