本文整理汇总了PHP中bp_is_root_blog函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_root_blog函数的具体用法?PHP bp_is_root_blog怎么用?PHP bp_is_root_blog使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_root_blog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: bp_core_confirmation_js
function bp_core_confirmation_js()
{
if (is_multisite() && !bp_is_root_blog()) {
return false;
}
if (!wp_script_is('jquery')) {
wp_enqueue_script('jquery');
}
if (!wp_script_is('jquery', 'done')) {
wp_print_scripts('jquery');
}
?>
<script type="text/javascript">
jQuery( document ).ready( function() {
jQuery( 'a.confirm').click( function() {
if ( confirm( '<?php
_e('Are you sure?', 'buddypress');
?>
' ) )
return true; else return false;
});
});
</script>
<?php
}
示例2: bp_register_default_taxonomies
/**
* Register our default taxonomies.
*
* @since 2.2.0
*/
function bp_register_default_taxonomies()
{
// Member Type.
register_taxonomy(bp_get_member_type_tax_name(), 'user', array('public' => false));
// Email type.
register_taxonomy(bp_get_email_tax_type(), bp_get_email_post_type(), apply_filters('bp_register_email_tax_type', array('description' => _x('BuddyPress email types', 'email type taxonomy description', 'buddypress'), 'labels' => bp_get_email_tax_type_labels(), 'meta_box_cb' => 'bp_email_tax_type_metabox', 'public' => false, 'query_var' => false, 'rewrite' => false, 'show_in_menu' => false, 'show_tagcloud' => false, 'show_ui' => bp_is_root_blog() && bp_current_user_can('bp_moderate'))));
}
示例3: grant_cap_foo
public function grant_cap_foo($allcaps, $caps)
{
if (bp_is_root_blog()) {
$allcaps['foo'] = 1;
}
return $allcaps;
}
示例4: bp_blogs_register_widgets
/**
* Register the widgets for the Blogs component.
*/
function bp_blogs_register_widgets()
{
global $wpdb;
if (bp_is_active('activity') && bp_is_root_blog($wpdb->blogid)) {
add_action('widgets_init', create_function('', 'return register_widget("BP_Blogs_Recent_Posts_Widget");'));
}
}
示例5: bp_core_confirmation_js
/**
* Load the JS for "Are you sure?" .confirm links.
*
* @since 1.1.0
*/
function bp_core_confirmation_js()
{
if (is_multisite() && !bp_is_root_blog()) {
return false;
}
wp_enqueue_script('bp-confirm');
wp_localize_script('bp-confirm', 'BP_Confirm', array('are_you_sure' => __('Are you sure?', 'buddypress')));
}
示例6: register_post_type
/**
* Register an hidden post type to save custom group front pages
*/
private function register_post_type()
{
if (!bp_is_root_blog()) {
return;
}
$labels = array('name' => _x('Groups front', 'post type general name', 'altctrl-public-group'), 'singular_name' => _x('Group front', 'post type singular name', 'altctrl-public-group'));
$args = array('labels' => $labels, 'public' => false, 'publicly_queryable' => false, 'show_ui' => false, 'show_in_menu' => false, 'query_var' => false, 'rewrite' => false, 'has_archive' => false, 'hierarchical' => true, 'supports' => array('editor'));
register_post_type('group_front', $args);
}
示例7: bp_core_confirmation_js
/**
* Load the JS for "Are you sure?" .confirm links.
*/
function bp_core_confirmation_js()
{
if (is_multisite() && !bp_is_root_blog()) {
return false;
}
$min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
wp_enqueue_script('bp-confirm', buddypress()->plugin_url . "bp-core/js/confirm{$min}.js", array('jquery'), bp_get_version());
wp_localize_script('bp-confirm', 'BP_Confirm', array('are_you_sure' => __('Are you sure?', 'buddypress')));
}
示例8: thatcamp_add_styles_alt
function thatcamp_add_styles_alt()
{
if (bp_is_root_blog()) {
return;
}
?>
<style type="text/css">
div.generic-button {
margin-bottom: 1rem;
}
div.generic-button a {
background: #668800 url('<?php
echo WP_CONTENT_URL;
?>
/themes/thatcamp-karma/assets/images/thatcamp-greenbutton.jpg');
border: 1px solid #668800;
opacity: 1;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
border-radius: 3px;
color: #ffffff;
cursor: pointer;
font-family: Francois One;
font-size: 1.1rem;
outline: none;
padding: 4px 10px;
text-align: center;
text-decoration: none;
line-height: 14px;
text-decoration: -1px -1px 0px #668800;
}
div.generic-button a:hover {
opacity: 0.9;
}
div.generic-button.disabled-button {
position: relative;
}
div.generic-button.disabled-button a {
opacity: 0.5;
}
div.generic-button.disabled-button span {
margin-left: -999em;
position: absolute;
}
div.generic-button.disabled-button:hover span {
border-radius: 5px 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px;
box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.1); -webkit-box-shadow: 5px 5px rgba(0, 0, 0, 0.1); -moz-box-shadow: 5px 5px rgba(0, 0, 0, 0.1);
position: absolute; left: 1em; top: 2em; z-index: 99;
margin-left: 0;
background: #FFFFAA; border: 1px solid #FFAD33;
padding: 4px 8px;
white-space: nowrap;
}
</style>
<?php
}
示例9: bp_get_object_terms
/**
* Get taxonomy terms for a BuddyPress object.
*
* @since BuddyPress (2.2.0)
*
* @see wp_get_object_terms() for a full description of function and parameters.
*
* @param int|array $object_ids ID or IDs of objects.
* @param string|array $taxonomies Name or names of taxonomies to match.
* @param array $args See {@see wp_get_object_terms()}.
* @return array
*/
function bp_get_object_terms( $object_ids, $taxonomies, $args = array() ) {
if ( ! bp_is_root_blog() ) {
switch_to_blog( bp_get_root_blog_id() );
}
$retval = wp_get_object_terms( $object_ids, $taxonomies, $args );
restore_current_blog();
return $retval;
}
示例10: bp_remove_object_terms
/**
* Remove taxonomy terms on a BuddyPress object.
*
* @since BuddyPress (2.3.0)
*
* @see wp_remove_object_terms() for a full description of function and parameters.
*
* @param int $object_id Object ID.
* @param string|array $terms Term or terms to remove.
* @param string $taxonomy Taxonomy name.
* @return bool|WP_Error True on success, false or WP_Error on failure.
*/
function bp_remove_object_terms($object_id, $terms, $taxonomy)
{
$is_root_blog = bp_is_root_blog();
if (!$is_root_blog) {
switch_to_blog(bp_get_root_blog_id());
}
$retval = wp_remove_object_terms($object_id, $terms, $taxonomy);
if (!$is_root_blog) {
restore_current_blog();
}
return $retval;
}
示例11: bp_friends_register_widgets
/**
* Register the friends widget.
*
* @since 1.9.0
*/
function bp_friends_register_widgets()
{
if (!bp_is_active('friends')) {
return;
}
// The Friends widget works only when looking an a displayed user,
// and the concept of "displayed user" doesn't exist on non-root blogs,
// so we don't register the widget there.
if (!bp_is_root_blog()) {
return;
}
add_action('widgets_init', create_function('', 'return register_widget("BP_Core_Friends_Widget");'));
}
示例12: setup_admin
/**
* Setup our admin settings page and hooks
*/
public function setup_admin()
{
// Temporary workaround for the fact that WP's settings API doesn't work with MS
if (bp_core_do_network_admin()) {
if (!bp_is_root_blog()) {
return;
}
$parent = 'options-general.php';
} else {
$parent = 'bp-general-settings';
}
$page = add_submenu_page($parent, __('BuddyPress Reply By Email', 'bp-rbe'), __('BP Reply By Email', 'bp-rbe'), 'manage_options', 'bp-rbe', array($this, 'load'));
add_action("admin_head-{$page}", array($this, 'head'));
add_action("admin_footer-{$page}", array($this, 'footer'));
}
示例13: bp_core_clear_directory_pages_cache_page_edit
/**
* Clear the directory_pages cache when one of the pages is updated.
*
* @since BuddyPress (2.0.0)
*
* @param int $post_id
*/
function bp_core_clear_directory_pages_cache_page_edit($post_id)
{
if (!bp_is_root_blog()) {
return;
}
// Bail if BP is not defined here
if (!buddypress()) {
return;
}
$page_ids = bp_core_get_directory_page_ids('all');
if (!in_array($post_id, (array) $page_ids)) {
return;
}
wp_cache_delete('directory_pages', 'bp');
}
示例14: wff_child_scripts
function wff_child_scripts()
{
if (WEFOSTER_LESS_TYPE == 'less') {
if (class_exists('BuddyPress') && bp_is_root_blog() || class_exists('BuddyPress') && defined('BP_ENABLE_MULTIBLOG') || WEFOSTER_MS_LOAD_BUDDYPRESS_STYLES == 'on') {
wp_enqueue_style('wff_child_custom_bp_less', get_stylesheet_directory_uri() . '/assets/css/bp.min.css', false, 'bdc9fa64dc6df3b6c674c3ea195c0d44');
}
wp_enqueue_style('wff_child_custom_main_less', get_stylesheet_directory_uri() . '/assets/css/main.min.css', false, 'bdc9fa64dc6df3b6c674c3ea195c0d44');
}
if (WEFOSTER_LESS_TYPE == 'css') {
wp_enqueue_style('wff_child_custom_css', get_stylesheet_directory_uri() . '/custom.css');
}
if (WEFOSTER_CUSTOM_JS == 'true') {
wp_register_script('wff_child_scripts', get_stylesheet_directory_uri() . '/assets/js/scripts.min.js', array(), '911acd948151184ec83b6b47b9bebfad', true);
}
wp_enqueue_script('wff_child_scripts');
}
示例15: bp_core_exclude_pages
/**
* bp_core_exclude_pages()
*
* Excludes specific pages from showing on page listings, for example the "Activation" page.
*
* @package BuddyPress Core
* @uses bp_is_active() checks if a BuddyPress component is active.
* @return array The list of page ID's to exclude
*/
function bp_core_exclude_pages($pages)
{
global $bp;
if (bp_is_root_blog()) {
if (!empty($bp->pages->activate)) {
$pages[] = $bp->pages->activate->id;
}
if (!empty($bp->pages->register)) {
$pages[] = $bp->pages->register->id;
}
if (!empty($bp->pages->forums) && (!bp_is_active('forums') || bp_is_active('forums') && bp_forums_has_directory() && !bp_forums_is_installed_correctly())) {
$pages[] = $bp->pages->forums->id;
}
}
return apply_filters('bp_core_exclude_pages', $pages);
}