本文整理汇总了PHP中bp_is_blog_page函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_blog_page函数的具体用法?PHP bp_is_blog_page怎么用?PHP bp_is_blog_page使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_blog_page函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: custom_media_nav_tab
/**
* Load Custom tabs on BuddyPress
*
* @global object $bp global BuddyPress object
*/
function custom_media_nav_tab()
{
global $bp;
if (!function_exists("bp_core_new_nav_item")) {
return;
}
if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
return;
}
global $rtmedia;
if (function_exists("bp_is_group") && !bp_is_group()) {
if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
$profile_counts = $this->actual_counts($bp->displayed_user->id);
}
$tab_position = apply_filters('rtmedia_media_tab_position', 99);
if ($rtmedia->options["buddypress_enableOnProfile"] != 0) {
bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
}
}
if (bp_is_group() && $rtmedia->options["buddypress_enableOnGroup"] != 0) {
global $bp;
$media_enabled = true;
//filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
$media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
// check if current user can view this group
$current_group = groups_get_current_group();
$is_visible_to_current_user = $current_group->is_visible;
if ($media_enabled && $is_visible_to_current_user) {
$group_counts = $this->actual_counts($bp->groups->current_group->id, "group");
$bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . '<span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . RTMEDIA_MEDIA_SLUG, 'slug' => RTMEDIA_MEDIA_SLUG, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
}
}
}
示例2: set_bp_context
/**
*
*/
function set_bp_context()
{
if (bp_is_blog_page() && !is_home()) {
$this->set_wp_context();
} else {
$this->set_bp_component_context();
}
}
示例3: wplms_remove_wpseo_from_buddypress
function wplms_remove_wpseo_from_buddypress()
{
if (function_exists('bp_is_blog_page')) {
if (!bp_is_blog_page()) {
global $wpseo_front;
remove_filter('wp_title', array($wpseo_front, 'title'), 15);
}
}
}
示例4: kleo_breadcrumb
/**
* Shows a breadcrumb for all types of pages. This is a wrapper function for the Breadcrumb_Trail class,
* which should be used in theme templates.
*
* @since 0.1.0
* @access public
* @param array $args Arguments to pass to Breadcrumb_Trail.
* @return void
*/
function kleo_breadcrumb($args = array())
{
if (function_exists('bp_is_active') && !bp_is_blog_page()) {
$breadcrumb = new buddypress_Breadcrumb_Trail($args);
} elseif (function_exists('is_bbpress') && is_bbpress()) {
$breadcrumb = new bbPress_Breadcrumb_Trail($args);
} else {
$breadcrumb = new Breadcrumb_Trail($args);
}
return $breadcrumb->trail();
}
示例5: custom_media_nav_tab
/**
* Load Custom tabs on BuddyPress
*
* @global object $bp global BuddyPress object
*/
function custom_media_nav_tab()
{
$bp = buddypress();
if (!function_exists('bp_core_new_nav_item')) {
return;
}
if (bp_is_blog_page() || !bp_is_group() && !(isset($bp->displayed_user) && isset($bp->displayed_user->id)) || apply_filters('rtmedia_render_bp_nav', false)) {
return;
}
global $rtmedia;
if (function_exists('bp_is_group') && !bp_is_group()) {
if (isset($bp->displayed_user) && isset($bp->displayed_user->id)) {
$profile_counts = $this->actual_counts($bp->displayed_user->id);
}
$tab_position = apply_filters('rtmedia_media_tab_position', 99);
if (0 !== intval($rtmedia->options['buddypress_enableOnProfile'])) {
bp_core_new_nav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $profile_counts['total']['all'] . '</span>', 'slug' => apply_filters('rtmedia_media_tab_slug', RTMEDIA_MEDIA_SLUG), 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all', 'position' => $tab_position));
}
}
if (bp_is_group() && 0 !== intval($rtmedia->options['buddypress_enableOnGroup'])) {
$media_enabled = true;
//filter for rtMedia PRO for PER GROUP MEDIA enable/disable functionality
$media_enabled = apply_filters('rtmedia_media_enabled_for_current_group', $media_enabled);
// check if current user can view this group
$current_group = groups_get_current_group();
/**
* remove `$current_group->is_visible` and add `bp_group_is_visible( $current_group )`
* reason : In Buddypress 2.7 `is_visible` return false so we can't display `media` tab on group
* issue id : http://git.rtcamp.com/rtmedia/rtMedia/issues/119
*/
// $is_visible_to_current_user = $current_group->is_visible;
$is_visible_to_current_user = bp_group_is_visible($current_group);
if ($media_enabled && $is_visible_to_current_user) {
$group_counts = $this->actual_counts($bp->groups->current_group->id, 'group');
$slug = apply_filters('rtmedia_group_media_tab_slug', RTMEDIA_MEDIA_SLUG);
if (isset($bp->version) && $bp->version > '2.5.3') {
/*
* As from BuddyPress 2.6, you can't access $bp->bp_options_nav directly.
* Use `bp_core_new_subnav_item` to add subnav item.
*
* Check https://buddypress.trac.wordpress.org/ticket/6534 and https://buddypress.trac.wordpress.org/changeset/10745
* for more details
*/
bp_core_new_subnav_item(array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'parent_slug' => bp_get_current_group_slug(), 'parent_url' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/'), 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all'));
} else {
$bp->bp_options_nav[bp_get_current_group_slug()]['media'] = array('name' => RTMEDIA_MEDIA_LABEL . ' <span>' . $group_counts['total']['all'] . '</span>', 'link' => trailingslashit(bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . bp_get_current_group_slug() . '/') . $slug, 'slug' => $slug, 'user_has_access' => true, 'css_id' => 'rtmedia-media-nav', 'position' => 99, 'screen_function' => array($this, 'media_screen'), 'default_subnav_slug' => 'all');
}
}
}
}
示例6: load_js
/**
* Include Javascript
*/
public function load_js()
{
$template_uri = get_template_directory_uri();
//yu read it right, bp-default theme js
wp_enqueue_script('dtheme-uniform-js', $template_uri . '/_inc/js/jquery.uniform.min.js', array('jquery'), bp_get_version());
wp_enqueue_script('enhance-js', $template_uri . '/_inc/js/enhance.js', array('jquery', 'dtheme-uniform-js'), bp_get_version());
// Enqueue the global JS - Ajax will not work without it
wp_enqueue_script('dtheme-ajax-js', $template_uri . '/_inc/js/global.js', array('jquery'), bp_get_version());
// Add words that we need to use in JS to the end of the page so they can be translated and still used.
$params = array('my_favs' => __('My Favorites', 'bp-magic'), 'accepted' => __('Accepted', 'bp-magic'), 'rejected' => __('Rejected', 'bp-magic'), 'show_all_comments' => __('Show all comments for this thread', 'bp-magic'), 'show_all' => __('Show all', 'bp-magic'), 'comments' => __('comments', 'bp-magic'), 'close' => __('Close', 'bp-magic'), 'view' => __('View', 'bp-magic'), 'mark_as_fav' => __('Favorite', 'bp-magic'), 'remove_fav' => __('Remove Favorite', 'bp-magic'));
wp_localize_script('dtheme-ajax-js', 'BP_DTheme', $params);
// Maybe enqueue comment reply JS
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
}
示例7: bp_admin_bar_remove_nxt_menus
/**
* Unhook the NXTClass core menus.
*
* @since BuddyPress (r4151)
*
* @uses remove_action
* @uses is_network_admin()
* @uses is_user_admin()
*/
function bp_admin_bar_remove_nxt_menus()
{
if ('3.2' == bp_get_major_nxt_version()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_my_account_menu', 10);
remove_action('admin_bar_menu', 'nxt_admin_bar_my_sites_menu', 20);
remove_action('admin_bar_menu', 'nxt_admin_bar_dashboard_view_site_menu', 25);
// Don't show the 'Edit Page' menu on BP pages
if (!bp_is_blog_page()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_edit_menu', 30);
}
remove_action('admin_bar_menu', 'nxt_admin_bar_shortlink_menu', 80);
remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
if (!is_network_admin() && !is_user_admin()) {
remove_action('admin_bar_menu', 'nxt_admin_bar_comments_menu', 50);
remove_action('admin_bar_menu', 'nxt_admin_bar_appearance_menu', 60);
}
remove_action('admin_bar_menu', 'nxt_admin_bar_updates_menu', 70);
}
}
示例8: maybe_redirect
/**
* Check user access and redirect if access denied
*/
public function maybe_redirect()
{
// always allow access to blog, registration and activation pages
if (bp_is_blog_page() || bp_is_register_page() || bp_is_activation_page()) {
return;
}
// grab toggle option from registry
$opt_toggle = $this->get_suboption('toggle');
// is option toggled on?
if ($opt_toggle && true == $opt_toggle->get()) {
// protection is enabled, is user logged in?
if (!is_user_logged_in()) {
// not logged in, redirect to registration page
bp_core_redirect(bp_get_root_domain() . '/' . bp_get_root_slug('register'));
// exit to avoid any accidental output
exit;
}
}
}
示例9: dpa_add_css
/**
* Enqueues CSS files.
*
* @since 2.0
* @global object $bp BuddyPress global settings
*/
function dpa_add_css()
{
global $bp;
if (is_active_widget(false, false, 'achievements-sitewide') || is_active_widget(false, false, 'achievements-available-achievements') || is_active_widget(false, false, 'achievements-member-achievements') || is_active_widget(false, false, 'achievements-featured-achievement') || is_active_widget(false, false, 'achievements-member-achievements-available') || is_active_widget(false, false, 'achievements-member-points')) {
nxt_enqueue_style('achievements-widget', plugins_url('/css/widget.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
if (!bp_is_current_component($bp->achievements->slug)) {
if (bp_is_active('activity') && bp_is_activity_component() && !bp_is_blog_page() || bp_is_component_front_page('activity') && bp_is_front_page()) {
nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
nxt_print_styles();
return;
}
if (DPA_SLUG_CREATE == $bp->current_action && dpa_permission_can_user_create() || DPA_SLUG_ACHIEVEMENT_EDIT == $bp->current_action && dpa_permission_can_user_edit() || DPA_SLUG_ACHIEVEMENT_CHANGE_PICTURE == $bp->current_action && dpa_permission_can_user_change_picture() || DPA_SLUG_ACHIEVEMENT_GRANT == $bp->current_action && dpa_permission_can_user_grant()) {
nxt_enqueue_style('achievements-admin', plugins_url('/css/admin.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
if ($bp->is_single_item) {
nxt_enqueue_style('achievements-detail', plugins_url('/css/detail.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
} else {
nxt_enqueue_style('achievements-directory', plugins_url('/css/directory.css', __FILE__), array(), ACHIEVEMENTS_VERSION);
}
nxt_print_styles();
}
示例10: wp_title
wp_title('|', true, 'right');
bloginfo('name');
?>
</title>
<?php
do_action('bp_head');
?>
<link rel="pingback" href="<?php
bloginfo('pingback_url');
?>
" />
<?php
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
wp_enqueue_script('comment-reply');
}
wp_head();
?>
</head>
<body <?php
body_class();
?>
id="bp-default">
<?php
do_action('bp_before_header');
?>
示例11: _bp_maybe_remove_rel_canonical
/**
* Remove WP's rel=canonical HTML tag if we are trying to load BP-specific content.
*
* This function should be considered temporary, and may be removed without
* notice in future versions of BuddyPress.
*
* @since 1.6.0
*/
function _bp_maybe_remove_rel_canonical()
{
if (!bp_is_blog_page() && !is_404()) {
remove_action('wp_head', 'rel_canonical');
add_action('bp_head', 'bp_rel_canonical');
}
}
示例12: bp_dtheme_add_blog_comments_js
/**
* In BuddyPress 1.2.x, this added the javascript needed for blog comment replies.
* As of 1.5.x, we recommend that you enqueue the comment-reply javascript in your theme's header.php.
*
* @deprecated 1.5
* @deprecated Enqueue the comment-reply script in your theme's header.php.
* @since 1.2
*/
function bp_dtheme_add_blog_comments_js()
{
_deprecated_function(__FUNCTION__, '1.5', "Enqueue the comment-reply script in your theme's header.php.");
if (is_singular() && bp_is_blog_page() && get_option('thread_comments')) {
nxt_enqueue_script('comment-reply');
}
}
示例13: bp_maybe_load_mentions_scripts_for_blog_content
/**
* Should BuddyPress load the mentions scripts and related assets, including results to prime the
* mentions suggestions?
*
* @param bool $load_mentions True to load mentions assets, false otherwise.
* @param bool $mentions_enabled True if mentions are enabled.
* @return bool True if mentions scripts should be loaded.
* @since BuddyPress (2.2.0)
*/
function bp_maybe_load_mentions_scripts_for_blog_content( $load_mentions, $mentions_enabled ) {
if ( ! $mentions_enabled ) {
return $load_mentions;
}
if ( $load_mentions || ( bp_is_blog_page() && is_singular() && comments_open() ) ) {
return true;
}
return $load_mentions;
}
示例14: bp_activity_maybe_load_mentions_scripts
/**
* Should BuddyPress load the mentions scripts and related assets, including results to prime the
* mentions suggestions?
*
* @return bool True if mentions scripts should be loaded.
* @since BuddyPress (2.1.0)
*/
function bp_activity_maybe_load_mentions_scripts()
{
$retval = bp_activity_do_mentions() && bp_is_user_active() && (bp_is_activity_component() || bp_is_blog_page() && is_singular() && comments_open() || is_admin());
return (bool) apply_filters('bp_activity_maybe_load_mentions_scripts', $retval);
}
示例15: bp_core_catch_no_access
/**
* Catches invalid access to BuddyPress pages and redirects them accordingly.
*
* @package BuddyPress Core
* @since 1.5
*/
function bp_core_catch_no_access()
{
global $bp, $bp_no_status_set, $nxt_query;
// If bp_core_redirect() and $bp_no_status_set is true,
// we are redirecting to an accessible page, so skip this check.
if ($bp_no_status_set) {
return false;
}
if (!isset($nxt_query->queried_object) && !bp_is_blog_page()) {
bp_do_404();
}
}