本文整理汇总了PHP中bp_is_groups_component函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_groups_component函数的具体用法?PHP bp_is_groups_component怎么用?PHP bp_is_groups_component使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_groups_component函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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'));
}
}
示例2: lsx_buddypress_page_columns
/**
* Forces the BP Profile Pages to be 1 Column
*
* @package lsx
* @subpackage jetpack
* @category infinite scroll
*/
function lsx_buddypress_page_columns($layout)
{
if (bp_is_profile_component() || bp_is_settings_component() || bp_is_activity_component() || bp_is_group() || bp_is_messages_component() || bp_is_members_directory() || bp_is_groups_directory() || bp_is_groups_component() || bp_is_members_component()) {
$layout = '1c';
}
return $layout;
}
示例3: bp_groupblog_blog_defaults
function bp_groupblog_blog_defaults($blog_id)
{
global $bp, $wp_rewrite;
// only apply defaults to groupblog blogs
if (bp_is_groups_component()) {
switch_to_blog($blog_id);
// get the site options
$options = get_site_option('bp_groupblog_blog_defaults_options');
foreach ((array) $options as $key => $value) {
update_option($key, $value);
}
// override default themes
if (!empty($options['theme'])) {
// we want something other than the default theme
$values = explode("|", $options['theme']);
switch_theme($values[0], $values[1]);
}
// groupblog bonus options
if (strlen($options['default_cat_name']) > 0) {
global $wpdb;
$cat = $options['default_cat_name'];
$slug = str_replace(' ', '-', strtolower($cat));
$results = $wpdb->query($wpdb->prepare("UPDATE {$wpdb->terms} SET name = %s, slug = %s WHERE term_id = 1", $cat, $slug));
}
if (strlen($options['default_link_cat']) > 0) {
global $wpdb;
$cat = $options['default_link_cat'];
$slug = str_replace(' ', '-', strtolower($cat));
$results = $wpdb->query($wpdb->prepare("UPDATE {$wpdb->terms} SET name = %s, slug = %s WHERE term_id = 2", $cat, $slug));
}
if (isset($options['delete_first_post']) && $options['delete_first_post'] == 1) {
global $wpdb;
$statement = "UPDATE {$wpdb->posts} SET post_status = 'draft' WHERE id = 1";
$results = $wpdb->query($statement);
}
if (isset($options['delete_first_comment']) && $options['delete_first_comment'] == 1) {
wp_delete_comment(1);
}
if ($options['delete_blogroll_links'] == 1) {
wp_delete_link(1);
//delete Wordpress.com blogroll link
wp_delete_link(2);
//delete Wordpress.org blogroll link
}
if ($options['redirectblog'] == 2) {
$blog_page = array('comment_status' => 'closed', 'ping_status' => 'closed', 'post_status' => 'publish', 'post_name' => $options['pageslug'], 'post_title' => $options['pagetitle'], 'post_type' => 'page', 'post_content' => __('<p><strong>This page has been created automatically by the BuddyPress GroupBlog plugin.</strong></p><p>Please contact the site admin if you see this message instead of your blog posts. Possible solution: please advise your site admin to create the <a href="http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates">page template</a> needed for the BuddyPress GroupBlog plugin.<p>', 'groupblog'));
$blog_page_id = wp_insert_post($blog_page);
if ($blog_page_id) {
add_post_meta($blog_page_id, '_wp_page_template', 'blog.php');
}
add_post_meta($blog_page_id, 'created_by_groupblog_dont_change', '1');
// Set the Blog Reading Settings to load the template page as front page
if ($options['deep_group_integration'] == 1) {
update_option('show_on_front', 'page');
update_option('page_on_front', $blog_page_id);
}
}
restore_current_blog();
}
}
示例4: ass_add_javascript
public function ass_add_javascript()
{
if (bp_is_groups_component()) {
wp_register_script('bp-activity-subscription-js', plugins_url() . '/buddypress-group-email-subscription/bp-activity-subscription-js.js', array('jquery'));
wp_enqueue_script('bp-activity-subscription-js');
wp_localize_script('bp-activity-subscription-js', 'bp_ass', array('mute' => __('Mute', 'bp-ass'), 'follow' => __('Follow', 'bp-ass'), 'error' => __('Error', 'bp-ass')));
}
}
示例5: bp_checkins_is_group_places_area
function bp_checkins_is_group_places_area()
{
if (bp_is_groups_component() && bp_is_single_item() && bp_is_current_action('checkins') && bp_action_variable(0) == 'places') {
return true;
} else {
return false;
}
}
示例6: ass_add_javascript
public function ass_add_javascript()
{
if (bp_is_groups_component()) {
$revision_date = '20130729';
wp_register_script('bp-activity-subscription-js', plugins_url('bp-activity-subscription-js.js', __FILE__), array('jquery'), $revision_date);
wp_enqueue_script('bp-activity-subscription-js');
wp_localize_script('bp-activity-subscription-js', 'bp_ass', array('mute' => __('Mute', 'bp-ass'), 'follow' => __('Follow', 'bp-ass'), 'error' => __('Error', 'bp-ass')));
}
}
示例7: bp_groupblog_add_screen_css
/**
* bp_groupblog_add_screen_css()
*/
function bp_groupblog_add_screen_css()
{
if (bp_is_groups_component()) {
if (file_exists(get_stylesheet_directory() . '/groupblog/css/style.css')) {
wp_enqueue_style('bp-groupblog-screen', get_stylesheet_directory_uri() . '/groupblog/css/style.css');
} else {
wp_enqueue_style('bp-groupblog-screen', plugins_url() . '/bp-groupblog/groupblog/css/style.css');
}
}
}
示例8: bphelp_pbpp_redirect
function bphelp_pbpp_redirect()
{
global $bp;
//IMPORTANT: Do not alter the following line.
$bphelp_my_redirect_slug = get_option('bphelp-my-redirect-slug', 'register');
if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bbp_is_single_forum() || bbp_is_single_topic() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_members_component() || bp_is_profile_component()) {
if (!is_user_logged_in()) {
bp_core_redirect(get_option('home') . '/' . $bphelp_my_redirect_slug);
}
}
}
示例9: bp_checkins_is_group_checkins_area
function bp_checkins_is_group_checkins_area()
{
if (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component')) {
return false;
}
if (bp_is_groups_component() && bp_is_single_item() && bp_is_current_action('checkins')) {
return true;
} else {
return false;
}
}
示例10: group_hierarchy_override_current_action
/**
* Catch requests for the groups component and find the requested group
*/
function group_hierarchy_override_current_action($current_action)
{
global $bp;
do_action('bp_group_hierarchy_route_requests');
/** Only process once - hopefully this won't have any side effects */
remove_action('bp_current_action', 'group_hierarchy_override_current_action');
/** Abort processing on dashboard pages and when not in groups component */
if (is_admin() && !strpos(admin_url('admin-ajax.php'), $_SERVER['REQUEST_URI'])) {
return $current_action;
}
if (!bp_is_groups_component()) {
return $current_action;
}
$groups_slug = bp_get_groups_root_slug();
bp_group_hierarchy_debug('Routing request');
bp_group_hierarchy_debug('Current component: ' . $bp->current_component);
bp_group_hierarchy_debug('Current action: ' . $current_action);
bp_group_hierarchy_debug('Groups slug: ' . $groups_slug);
bp_group_hierarchy_debug('Are we on a user profile page?: ' . (empty($bp->displayed_user->id) ? 'N' : 'Y'));
if ($current_action == '') {
return $current_action;
}
if (!empty($bp->displayed_user->id) || in_array($current_action, apply_filters('groups_forbidden_names', array('my-groups', 'create', 'invites', 'send-invites', 'forum', 'delete', 'add', 'admin', 'request-membership', 'members', 'settings', 'avatar', $groups_slug, '')))) {
bp_group_hierarchy_debug('Not rewriting current action.');
return $current_action;
}
$action_vars = $bp->action_variables;
$group = new BP_Groups_Hierarchy($current_action);
if (!$group->id && (!isset($bp->current_item) || !$bp->current_item)) {
$current_action = '';
bp_group_hierarchy_debug('Group not found - returning 404.');
bp_do_404();
return;
}
if ($group->has_children()) {
$parent_id = $group->id;
foreach ($bp->action_variables as $action_var) {
$subgroup_id = BP_Groups_Hierarchy::check_slug($action_var, $parent_id);
if ($subgroup_id) {
$action_var = array_shift($action_vars);
$current_action .= '/' . $action_var;
$parent_id = $subgroup_id;
} else {
// once we find something that isn't a group, we're done
break;
}
}
}
bp_group_hierarchy_debug('Action changed to: ' . $current_action);
$bp->action_variables = $action_vars;
$bp->current_action = $current_action;
return $current_action;
}
示例11: update_activity_privacy_option
/**
* Hooked to `bp_activity_entry_meta`
*
* Show privacy dropdown inside activity loop along with activity meta buttons.
*/
function update_activity_privacy_option()
{
if (function_exists('bp_activity_user_can_delete') && bp_activity_user_can_delete() && !bp_is_groups_component() && is_rtmedia_privacy_user_overide() && apply_filters('rtm_load_bp_activity_privacy_update_ui', true)) {
global $activities_template;
$selected = 0;
if (isset($activities_template->activity->privacy)) {
$selected = intval($activities_template->activity->privacy);
}
//todo strict standard error
self::select_privacy_ui(true, 'rtm-ac-privacy-' . $activities_template->activity->id, array('rtm-activity-privacy-opt'), $selected);
}
}
示例12: thatcamp_new_group_rss_catcher
function thatcamp_new_group_rss_catcher()
{
global $wp_query;
$feed_template = false;
if (bp_is_groups_component() && bp_is_current_action('feed')) {
$feed_template = 'rss-newest-groups.php';
}
if (!$feed_template) {
return;
}
$wp_query->is_404 = false;
status_header(200);
include __DIR__ . '/includes/' . $feed_template;
die;
}
示例13: logged_out_redirect
function logged_out_redirect()
{
global $bp;
// BuddyPress components to lock
if (bp_is_activity_component() || bp_is_groups_component() || bp_is_group_forum() || bp_is_forums_component() || bp_is_blogs_component() || bp_is_page(BP_MEMBERS_SLUG) || bp_is_profile_component()) {
// Check if user is logged out
if (!is_user_logged_in()) {
// Check if a page was selected for redirection
if (of_get_option('redirect')) {
$redirect_page = get_permalink(of_get_option('redirect'));
// If not redirect to login page
} else {
$redirect_page = site_url('/wp-login.php');
}
wp_redirect($redirect_page);
exit;
}
}
}
示例14: meso_schema_breadcrumbs
//.........这里部分代码省略.........
}
}
if ($taxlist) {
echo $taxlist;
}
}
echo ' ' . $delimiter . ' ' . __('You are reading »', 'mesocolumn');
} else {
$category = get_the_category();
if ($category) {
foreach ($category as $cat) {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_category_link($cat->term_id) . '">' . '<span' . $schema_prop_title . '>' . $cat->name . '</span>' . '</a></span>' . $delimiter . ' ';
}
}
echo __('You are reading »', 'mesocolumn');
}
} elseif (!is_single() && !is_page() && get_post_type() != 'post' && !is_404()) {
$post_type = get_post_type_object(get_post_type());
echo $before . $post_type->labels->singular_name . $after;
} elseif (is_attachment()) {
$parent = get_post($post->post_parent);
$cat = get_the_category($parent->ID);
$cat = $cat[0];
if ($cat) {
echo get_category_parents($cat, TRUE, ' ' . $delimiter . ' ');
}
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink($parent) . '">' . '<span' . $schema_prop_title . '>' . $parent->post_title . '</span>' . '</a></span>';
if ($showCurrent == 1) {
echo ' ' . $delimiter . ' ' . $before . get_the_title() . $after;
}
} elseif (is_page() && !$post->post_parent) {
if (class_exists('buddypress')) {
global $bp;
if (bp_is_groups_component()) {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('groups') . '</span>' . '</a></span>';
if (!bp_is_directory()) {
echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '">' . '<span' . $schema_prop_title . '>' . bp_current_item() . '</span>' . '</a></span>';
if (bp_current_action()) {
echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('groups') . '/' . bp_current_item() . '/' . bp_current_action() . '">' . '<span' . $schema_prop_title . '>' . bp_current_action() . '</span>' . '</a></span>';
}
}
} else {
if (bp_is_members_directory()) {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
} else {
if (bp_is_user()) {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . home_url() . '/' . bp_get_root_slug('members') . '">' . '<span' . $schema_prop_title . '>' . bp_get_root_slug('members') . '</span>' . '</a></span>';
echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . '">' . '<span' . $schema_prop_title . '>' . bp_get_displayed_user_username() . '</span>' . '</a></span>';
if (bp_current_action()) {
echo $delimiter . '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . bp_core_get_user_domain($bp->displayed_user->id) . bp_current_component() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
}
} else {
if (bp_is_directory()) {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . bp_current_component() . '</span>' . '</a></span>';
} else {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
}
}
}
}
} else {
echo '<span' . $schema_link . '><a' . $schema_prop_url . ' href="' . get_permalink() . '">' . '<span' . $schema_prop_title . '>' . the_title_attribute('echo=0') . '</span>' . '</a></span>';
}
} elseif (is_page() && $post->post_parent) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
示例15: bp_is_group_admin_screen
function bp_is_group_admin_screen($slug)
{
if (!bp_is_groups_component() || !bp_is_current_action('admin')) {
return false;
}
if (bp_is_action_variable($slug)) {
return true;
}
return false;
}