• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP bp_current_component函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中bp_current_component函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_current_component函数的具体用法?PHP bp_current_component怎么用?PHP bp_current_component使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了bp_current_component函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: friends_screen_requests

/**
 * Catch and process the Requests page.
 */
function friends_screen_requests()
{
    if (bp_is_action_variable('accept', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_accept_friendship');
        if (friends_accept_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship accepted', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be accepted', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('reject', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_reject_friendship');
        if (friends_reject_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship rejected', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be rejected', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('cancel', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_withdraw_friendship');
        if (friends_withdraw_friendship(bp_loggedin_user_id(), bp_action_variable(1))) {
            bp_core_add_message(__('Friendship request withdrawn', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship request could not be withdrawn', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    }
    do_action('friends_screen_requests');
    bp_core_load_template(apply_filters('friends_template_requests', 'members/single/home'));
}
开发者ID:eresyyl,项目名称:mk,代码行数:36,代码来源:bp-friends-screens.php


示例2: friends_screen_requests

function friends_screen_requests()
{
    if (bp_is_action_variable('accept', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_accept_friendship');
        if (friends_accept_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship accepted', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be accepted', 'buddypress'), 'error');
        }
        bp_core_redirect(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action());
    } elseif (bp_is_action_variable('reject', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_reject_friendship');
        if (friends_reject_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship rejected', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be rejected', 'buddypress'), 'error');
        }
        bp_core_redirect(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action());
    }
    do_action('friends_screen_requests');
    if (isset($_GET['new'])) {
        bp_core_delete_notifications_by_type(bp_loggedin_user_id(), 'friends', 'friendship_request');
    }
    bp_core_load_template(apply_filters('friends_template_requests', 'members/single/home'));
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:27,代码来源:bp-friends-screens.php


示例3: bp_course_add_js

function bp_course_add_js()
{
    global $bp;
    if (!function_exists('vibe_logo_url')) {
        return;
    }
    // Checks if WPLMS is active in current site in WP Multisite
    wp_enqueue_script('bp-extras-js', plugins_url('/vibe-course-module/includes/js/course-module-js.min.js'), array('jquery'), bp_course_version(), true);
    if (function_exists('vibe_get_option')) {
        if (is_singular('unit') || is_singular('question') || is_singular('quiz') || is_singular('wplms-assignment') || is_page(vibe_get_option('take_course_page')) || is_page(vibe_get_option('create_course')) || isset($_GET['edit'])) {
            wp_enqueue_script('jquery-ui-core');
            wp_enqueue_script('jquery-ui-sortable');
            wp_enqueue_script('jquery-ui-droppable');
            wp_enqueue_script('jquery-ui-datepicker');
            wp_enqueue_script('knob-js', plugins_url('/vibe-course-module/includes/js/jquery.knob.min.js'));
        }
    }
    if (function_exists('bp_is_directory')) {
        if (bp_is_directory() && bp_current_component() == 'course') {
            wp_enqueue_script('jquery-ui-datepicker');
        }
    }
    $action = bp_current_action();
    if (isset($_GET['action'])) {
        $action = $_GET['action'];
    }
    if (in_array($action, array('admin', 'submissions', 'stats'))) {
        wp_enqueue_script('knob-js', plugins_url('/vibe-course-module/includes/js/jquery.knob.min.js'));
    }
    wp_enqueue_script('bp-course-js', plugins_url('/vibe-course-module/includes/js/course.js'), array('jquery', 'wp-mediaelement', 'buddypress-js'), bp_course_version(), true);
    $color = bp_wplms_get_theme_color();
    $single_dark_color = bp_wplms_get_theme_single_dark_color();
    $translation_array = array('too_fast_answer' => _x('Too Fast or Answer not marked.', 'Quiz answer being marked very fast', 'vibe'), 'answer_saved' => _x('Answer Saved.', 'Save answer on every question, confirmation message', 'vibe'), 'processing' => _x('Processing...', 'Quiz question anwer save under progress', 'vibe'), 'saving_answer' => _x('Saving Answer...please wait', 'Saving quiz answers under progress', 'vibe'), 'remove_user_text' => __('This step is irreversible. Are you sure you want to remove the User from the course ?', 'vibe'), 'remove_user_button' => __('Confirm, Remove User from Course', 'vibe'), 'confirm' => _x('Confirm', 'Confirm button for various popup confirmation messages', 'vibe'), 'cancel' => _x('Cancel', 'Cancel button for various popup confirmation messages', 'vibe'), 'reset_user_text' => __('This step is irreversible. All Units, Quiz results would be reset for this user. Are you sure you want to Reset the Course for this User?', 'vibe'), 'reset_user_button' => __('Confirm, Reset Course for this User', 'vibe'), 'quiz_reset' => __('This step is irreversible. All Questions answers would be reset for this user. Are you sure you want to Reset the Quiz for this User? ', 'vibe'), 'quiz_reset_button' => __('Confirm, Reset Quiz for this User', 'vibe'), 'marks_saved' => __('Marks Saved', 'vibe'), 'quiz_marks_saved' => __('Quiz Marks Saved', 'vibe'), 'submit_quiz' => __('Submit Quiz', 'vibe'), 'sending_messages' => __('Sending Messages ...', 'vibe'), 'adding_students' => __('Adding Students to Course ...', 'vibe'), 'successfuly_added_students' => __('Students successfully added to Course', 'vibe'), 'unable_add_students' => __('Unable to Add students to Course', 'vibe'), 'select_fields' => __('Please select fields to download', 'vibe'), 'download' => __('Download', 'vibe'), 'timeout' => __('TIMEOUT', 'vibe'), 'theme_color' => $color, 'single_dark_color' => $single_dark_color, 'for_course' => __('for Course', 'vibe'), 'active_filters' => __('Active Filters', 'vibe'), 'clear_filters' => __('Clear all filters', 'vibe'), 'remove_comment' => __('Are you sure you want to remove this note?', 'vibe'), 'remove_comment_button' => __('Confirm, remove note', 'vibe'), 'private_comment' => __('Make Private', 'vibe'), 'add_comment' => __('Add your note', 'vibe'), 'submit_quiz_error' => __('Please add questions or retake the quiz !', 'vibe'), 'remove_announcement' => __('Are you sure you want to remove this Annoucement?', 'vibe'), 'start_quiz_notification' => __('You\'re about to start the Quiz. Please click confirm to begin the quiz.', 'vibe'), 'submit_quiz_notification' => __('Are you sure you want to submit the quiz. Submitting the quiz will freeze all your answers, you can not change them.  Please confirm.', 'vibe'), 'check_results' => __('Check results', 'vibe'), 'correct' => __('Correct', 'vibe'), 'incorrect' => __('Incorrect', 'vibe'), 'confirm_apply' => _x('Are you sure you want to apply for this Course ?', 'confirmation message when user clicks on apply for course', 'vibe'), 'instructor_uncomplete_unit' => _x('Are you sure you want mark this unit "uncomplete" for the user ?', 'Popup confirmation message when instructor marks the unit uncomplete for the user.', 'vibe'), 'instructor_complete_unit' => _x('Are you sure you want to mark this unit "complete" for the user ?', 'Popup confirmation message ', 'vibe'), 'unanswered_questions' => __('You have few unanswered questions. Are you sure you want to continue ?', 'vibe'));
    wp_localize_script('bp-course-js', 'vibe_course_module_strings', $translation_array);
}
开发者ID:nikitansk,项目名称:devschool,代码行数:35,代码来源:bp-course-cssjs.php


示例4: has_access

 /**
  * Verify access to the current content.
  *
  * Related:
  * A reference of available BuddyPress template tags
  * https://codex.buddypress.org/developer/template-tag-reference/
  *
  * @since  1.0.0
  *
  * @param int $id The content post ID to verify access.
  * @return bool|null True if has access, false otherwise.
  *     Null means: Rule not relevant for current page.
  */
 public function has_access($id, $admin_has_access = true)
 {
     global $bp;
     $has_access = null;
     if (!function_exists('bp_current_component')) {
         return null;
     }
     if (is_buddypress()) {
         // Check if access to *all* BuddyPress pages is restricted
         $has_access = parent::has_access(MS_Addon_BuddyPress_Rule::PROTECT_ALL, $admin_has_access);
     }
     if ($has_access) {
         // General BuddyPress access is either *allowed* or *not denied*
         $component = bp_current_component();
         if (!empty($component)) {
             if ('members' == $component || bp_is_user()) {
                 // Member listing or member profile access.
                 $has_access = parent::has_access(MS_Addon_BuddyPress_Rule::PROTECT_MEMBERS, $admin_has_access);
             } elseif ('messages' == $component) {
                 // Private messaging direct access.
                 if ('compose' == $bp->current_action) {
                     $has_access = parent::has_access(MS_Addon_BuddyPress_Rule::PROTECT_PRIVATE_MSG, $admin_has_access);
                 }
             } elseif ('messages' == $component) {
                 // Don't modify, handled by MS_Addon_Buddypress_Rule_Group
             } else {
                 // Other BP pages can be handled by other rules.
                 $has_access = null;
             }
         }
     }
     return apply_filters('ms_rule_buddypress_has_access', $has_access, $id, $this);
 }
开发者ID:jsandlin85,项目名称:SkylineSports,代码行数:46,代码来源:class-ms-addon-buddypress-rule-model.php


示例5: bp_media_delete_button_handler

function bp_media_delete_button_handler($link)
{
    if (bp_current_component() == 'media') {
        $link = str_replace('delete-activity ', 'delete-activity-single ', $link);
    }
    return $link;
}
开发者ID:rolandinsh,项目名称:buddypress-media,代码行数:7,代码来源:bp-media-filters.php


示例6: tie_register

function tie_register()
{
    ## Register Main style.css file
    wp_register_style('tie-style', get_stylesheet_uri(), array(), '', 'all');
    wp_enqueue_style('tie-style');
    ## Register All Scripts
    wp_register_script('tie-scripts', get_template_directory_uri() . '/js/tie-scripts.js', array('jquery'), false, true);
    wp_register_script('tie-tabs', get_template_directory_uri() . '/js/tabs.min.js', array('jquery'), false, true);
    wp_register_script('tie-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.js', array('jquery'), false, true);
    wp_register_script('tie-validation', get_template_directory_uri() . '/js/validation.js', array('jquery'), false, true);
    wp_register_script('tie-flexslider', get_template_directory_uri() . '/js/jquery.flexslider-min.js', array('jquery'), false, true);
    ## Get Global Scripts
    wp_enqueue_script('tie-scripts');
    ## Register WooCommerce css file
    wp_register_style('tie-woocommerce', get_template_directory_uri() . '/css/woocommerce.css', array(), '', 'all');
    if (class_exists('Woocommerce')) {
        wp_enqueue_style('tie-woocommerce');
    }
    ## Get Validation Script
    if (tie_get_option('comment_validation') && (is_page() || is_single()) && comments_open()) {
        wp_enqueue_script('tie-validation');
    }
    ## For facebook & Google + share
    if (is_singular() && tie_get_option('post_og_cards') && (!function_exists('bp_current_component') || function_exists('bp_current_component') && !bp_current_component())) {
        tie_og_data();
    }
}
开发者ID:fedeB-IT-dept,项目名称:fedeB_website,代码行数:27,代码来源:common-scripts.php


示例7: mpp_is_component_gallery

/**
 * Are we on component gallery
 * 
 * Is gallery associated to a component(groups/events etc)
 * 
 * @return boolean
 */
function mpp_is_component_gallery()
{
    $is_gallery = false;
    if (bp_is_current_action(MPP_GALLERY_SLUG) && mpp_is_active_component(bp_current_component())) {
        $is_gallery = true;
    }
    return apply_filters('mpp_is_component_gallery', $is_gallery);
}
开发者ID:baden03,项目名称:mediapress,代码行数:15,代码来源:conditionals.php


示例8: tie_register

function tie_register()
{
    ## Register Main style.css file
    wp_register_style('tie-style', get_stylesheet_uri(), array(), '', 'all');
    wp_enqueue_style('tie-style');
    ## Register All Scripts
    wp_register_script('tie-scripts', get_template_directory_uri() . '/js/tie-scripts.js', array('jquery'), false, true);
    wp_register_script('tie-tabs', get_template_directory_uri() . '/js/tabs.min.js', array('jquery'), false, true);
    wp_register_script('tie-cycle', get_template_directory_uri() . '/js/jquery.cycle.all.js', array('jquery'), false, true);
    wp_register_script('tie-validation', get_template_directory_uri() . '/js/validation.js', array('jquery'), false, true);
    wp_register_script('tie-masonry', get_template_directory_uri() . '/js/isotope.js', array('jquery'), false, true);
    wp_register_script('tie-ilightbox', get_template_directory_uri() . '/js/ilightbox.packed.js', array('jquery'), false, true);
    ## Get Global Scripts
    wp_enqueue_script('tie-scripts');
    wp_enqueue_script('tie-ilightbox');
    ## Register WooCommerce css file
    wp_register_style('tie-woocommerce', get_template_directory_uri() . '/css/woocommerce.css', array(), '', 'all');
    if (class_exists('Woocommerce')) {
        wp_enqueue_style('tie-woocommerce');
    }
    ## Register bbPress css file
    wp_register_style('tie-bbpress', get_template_directory_uri() . '/css/bbpress.css', array(), '', 'all');
    if (class_exists('bbpress')) {
        wp_enqueue_style('tie-bbpress');
    }
    ## Register buddyPress css file
    wp_register_style('tie-buddypress', get_template_directory_uri() . '/css/buddypress.css', array(), '', 'all');
    if (class_exists('buddypress')) {
        wp_enqueue_style('tie-buddypress');
    }
    ## Get Validation Script
    if (tie_get_option('comment_validation') && is_singular() && comments_open()) {
        wp_enqueue_script('tie-validation');
    }
    $lightbox_skin = 'dark';
    if (tie_get_option('lightbox_skin')) {
        $lightbox_skin = tie_get_option('lightbox_skin');
    }
    wp_enqueue_style('tie-ilightbox-skin', get_template_directory_uri() . '/css/ilightbox/' . $lightbox_skin . '-skin/skin.css');
    ## For facebook & Google + share
    if (is_singular() && tie_get_option('post_og_cards') && (!function_exists('bp_current_component') || function_exists('bp_current_component') && !bp_current_component())) {
        tie_og_data();
    }
    ## Sticky Sidebars
    $sticky_sidebar = false;
    if (tie_get_option('sticky_sidebar')) {
        $sticky_sidebar = true;
        if ((is_home() || is_front_page()) && tie_get_option('sticky_sidebar_disable_homepage') || is_page() && tie_get_option('sticky_sidebar_disable_pages') || is_single() && tie_get_option('sticky_sidebar_disable_posts') || is_tag() && tie_get_option('sticky_sidebar_disable_tag') || is_category() && tie_get_option('sticky_sidebar_disable_cat')) {
            $sticky_sidebar = false;
        }
    }
    ## Inline Vars
    $tie_js_vars = array("mobile_menu_active" => tie_get_option('mobile_menu_active'), "mobile_menu_top" => tie_get_option('mobile_menu_top'), "lightbox_all" => tie_get_option('lightbox_all'), "lightbox_gallery" => tie_get_option('lightbox_gallery'), "woocommerce_lightbox" => get_option('woocommerce_enable_lightbox'), "lightbox_skin" => $lightbox_skin, "lightbox_thumb" => tie_get_option('lightbox_thumbs'), "lightbox_arrows" => tie_get_option('lightbox_arrows'), "sticky_sidebar" => $sticky_sidebar, "is_singular" => is_singular(), "reading_indicator" => tie_get_option('reading_indicator'), "lang_no_results" => __ti('No Results'), "lang_results_found" => __ti('Results Found'));
    wp_localize_script('tie-scripts', 'tie', $tie_js_vars);
}
开发者ID:NguyenHiep,项目名称:learn-wp,代码行数:55,代码来源:common-scripts.php


示例9: bp_docs_is_bp_docs_page

/**
 * Determine whether you are viewing a BuddyPress Docs page
 *
 * @package BuddyPress Docs
 * @since 1.0-beta
 *
 * @return bool
 */
function bp_docs_is_bp_docs_page()
{
    global $bp;
    $is_bp_docs_page = false;
    // This is intentionally ambiguous and generous, to account for BP Docs is different
    // components. Probably should be cleaned up at some point
    if ($bp->bp_docs->slug == bp_current_component() || $bp->bp_docs->slug == bp_current_action()) {
        $is_bp_docs_page = true;
    }
    return apply_filters('bp_docs_is_bp_docs_page', $is_bp_docs_page);
}
开发者ID:Nightgunner5,项目名称:Pubcomp-CMS,代码行数:19,代码来源:templatetags.php


示例10: test_group_access_test_no_group_during_group_creation

 /**
  * @group invite_anyone_group_invite_access_test
  */
 public function test_group_access_test_no_group_during_group_creation()
 {
     $cc = bp_current_component();
     $ca = bp_current_action();
     buddypress()->current_component = buddypress()->groups->id;
     buddypress()->current_action = 'create';
     $u = $this->factory->user->create();
     $this->assertSame('anyone', invite_anyone_group_invite_access_test(0, $u));
     buddypress()->current_component = $cc;
     buddypress()->current_action = $ca;
 }
开发者ID:socialray,项目名称:surfied-2-0,代码行数:14,代码来源:test-sample.php


示例11: setup_globals

 /**
  * Setup globals
  *
  * The BP_MEMBERS_SLUG constant is deprecated, and only used here for
  * backwards compatibility.
  *
  * @since 1.5
  * @global obj $bp
  */
 function setup_globals()
 {
     global $bp, $current_user, $displayed_user_id;
     // Define a slug, if necessary
     if (!defined('BP_MEMBERS_SLUG')) {
         define('BP_MEMBERS_SLUG', $this->id);
     }
     $globals = array('path' => BP_PLUGIN_DIR, 'slug' => BP_MEMBERS_SLUG, 'root_slug' => isset($bp->pages->members->slug) ? $bp->pages->members->slug : BP_MEMBERS_SLUG, 'has_directory' => true, 'search_string' => __('Search Members...', 'buddypress'));
     parent::setup_globals($globals);
     /** Logged in user ****************************************************/
     // Fetch the full name for the logged in user
     $bp->loggedin_user->fullname = bp_core_get_user_displayname(bp_loggedin_user_id());
     // Hits the DB on single WP installs so get this separately
     $bp->loggedin_user->is_super_admin = $bp->loggedin_user->is_site_admin = is_super_admin(bp_loggedin_user_id());
     // The domain for the user currently logged in. eg: http://domain.com/members/andy
     $bp->loggedin_user->domain = bp_core_get_user_domain(bp_loggedin_user_id());
     // The core userdata of the user who is currently logged in.
     $bp->loggedin_user->userdata = bp_core_get_core_userdata(bp_loggedin_user_id());
     /** Displayed user ****************************************************/
     // The domain for the user currently being displayed
     $bp->displayed_user->domain = bp_core_get_user_domain(bp_displayed_user_id());
     // The core userdata of the user who is currently being displayed
     $bp->displayed_user->userdata = bp_core_get_core_userdata(bp_displayed_user_id());
     // Fetch the full name displayed user
     $bp->displayed_user->fullname = bp_core_get_user_displayname(bp_displayed_user_id());
     /** Profiles Fallback *************************************************/
     if (!bp_is_active('xprofile')) {
         $bp->profile->slug = 'profile';
         $bp->profile->id = 'profile';
     }
     /** Default Profile Component *****************************************/
     if (!defined('BP_DEFAULT_COMPONENT')) {
         if (bp_is_active('activity') && isset($bp->pages->activity)) {
             $bp->default_component = bp_get_activity_slug();
         } else {
             $bp->default_component = 'xprofile' == $bp->profile->id ? 'profile' : $bp->profile->id;
         }
     } else {
         $bp->default_component = BP_DEFAULT_COMPONENT;
     }
     if (!bp_current_component() && bp_displayed_user_id()) {
         /**
          * BuddyPress will attempt to resolve to the most specific URL possible,
          * to avoid search-engine-unfriendly content reduplication. Filter
          * bp_guarantee_unique_uris (and return false) to avoid this behavior
          */
         if (apply_filters('bp_guarantee_unique_uris', true)) {
             bp_core_redirect(bp_displayed_user_domain() . $bp->default_component);
         } else {
             $bp->current_component = $bp->default_component;
         }
     }
 }
开发者ID:newington,项目名称:buddypress,代码行数:62,代码来源:bp-members-loader.php


示例12: __construct

 public function __construct(&$plugin)
 {
     $this->p =& $plugin;
     $this->p->debug->mark();
     if (is_admin() || bp_current_component()) {
         $this->p->util->add_plugin_filters($this, array('post_types' => 3));
         // load sharing buttons code if sharing features exist and are enabled
         if (array_key_exists('ssb', $this->p->is_avail) && $this->p->is_avail['ssb'] === true) {
             $classname = __CLASS__ . 'Sharing';
             $this->sharing = new $classname($this->p);
         }
     }
 }
开发者ID:christocmp,项目名称:bingopaws,代码行数:13,代码来源:buddypress.php


示例13: breadcrumb_bp_current_item

function breadcrumb_bp_current_item($item)
{
    $params = array('bp_component' => bp_current_component(), 'bp_item' => bp_current_item(), 'bp_action' => bp_current_action(), 'bp_action_variables' => bp_action_variables());
    switch (bp_current_component()) {
        case false:
            return $item;
            break;
        case 'groups':
            return new Breadcrumb_BP_Component_Group($item, $params);
            break;
        default:
            return new Breadcrumb_BP_Component($item, $params);
    }
}
开发者ID:kubens,项目名称:Snippets,代码行数:14,代码来源:bp.php


示例14: dt_theme_bbpress_title

function dt_theme_bbpress_title(){
	global $bp;
	$doctitle = "";
	$separator = dttheme_option ( 'seo', 'title-delimiter' );
	$id = 0;

	if ( !empty( $bp->displayed_user->fullname ) ) {
		
		$blog_title = preg_replace ( "~(?:\[/?)[^/\]]+/?\]~s", '', get_option ( 'blogname' ));
		$title =  bp_current_component() === "profile" ? __("Profile","dt_themes") : __("Member","dt_themes");
		$subtitle = strip_tags( $bp->displayed_user->fullname );
		$doctitle = $blog_title.' '.$separator.' '.$title.' '.$separator.' '.$subtitle.' '.$separator;

	} elseif( bp_is_members_component() ) {
		$id = $bp->pages->members->id;
	}elseif( bp_is_activity_component() ){
		$id = $bp->pages->activity->id;
	}elseif( bp_current_component() === "groups" ) {
		$id = $bp->pages->groups->id;
	}elseif( bp_current_component() === "register" ) {
		$id = $bp->pages->register->id;
	}elseif( bp_current_component() === "activate" ) {
		$id = $bp->pages->activate->id;
	}
	if( $id > 0 ){
		global $post;
		$args = array (
			"blog_title" => preg_replace ( "~(?:\[/?)[^/\]]+/?\]~s", '', get_option ( 'blogname' ) ),
			"blog_description" => get_bloginfo ( 'description' ),
			"post_title" => ! empty ( $post ) ? $post->post_title : NULL,
			"post_author_nicename" => ! empty ( $nickname ) ? ucwords ( $nickname ) : NULL,
			"post_author_firstname" => ! empty ( $first_name ) ? ucwords ( $first_name ) : NULL,
			"post_author_lastname" => ! empty ( $last_name ) ? ucwords ( $last_name ) : NULL,
			"post_author_dsiplay" => ! empty ( $display_name ) ? ucwords ( $display_name ) : NULL );
		$args = array_filter ( $args );

		$doctitle = get_post_meta ( $id, '_seo_title', true );
		if (empty ( $doctitle )) :
			$options = is_array ( dttheme_option ( 'seo', 'page-title-format' ) ) ? dttheme_option ( 'seo', 'page-title-format' ) : array ();
			foreach ( $options as $option ) :
				if (array_key_exists ( $option, $args ))
					$doctitle .= $args [$option] . ' ' . $separator . ' ';
			endforeach;
		endif;

	}	
	
	return $doctitle;
}
开发者ID:namnguyen2312,项目名称:spa,代码行数:49,代码来源:utils.php


示例15: __construct

 public function __construct(&$plugin)
 {
     $this->p =& $plugin;
     if ($this->p->debug->enabled) {
         $this->p->debug->mark();
     }
     if (is_admin() || bp_current_component()) {
         if (!empty($this->p->is_avail['ssb'])) {
             $classname = __CLASS__ . 'Sharing';
             if (class_exists($classname)) {
                 $this->sharing = new $classname($this->p);
             }
         }
     }
 }
开发者ID:leotaillard,项目名称:btws2016,代码行数:15,代码来源:buddypress.php


示例16: gmw_sweetdate_geolocation_init

function gmw_sweetdate_geolocation_init()
{
    define('GMW_SD_PATH', GMW_PATH . '/plugins/sweetdate-geolocation/');
    define('GMW_SD_URL', GMW_URL . '/plugins/sweetdate-geolocation/');
    //admin settings
    if (is_admin() && !defined('DOING_AJAX')) {
        include 'includes/admin/geo-my-wp-sd-admin.php';
        new GMW_SD_Admin();
    }
    //include members query only on members page
    if (bp_current_component() == 'members') {
        include 'includes/geo-my-wp-sd-class.php';
        new GMW_SD_Class_Query();
    }
}
开发者ID:ankushpofale,项目名称:findyouneed-testing-,代码行数:15,代码来源:loader.php


示例17: sith_register

function sith_register()
{
    ## Register Main style.css file
    wp_register_style('sith-style', get_stylesheet_uri(), array(), '', 'all');
    wp_enqueue_style('sith-style');
    ## Register All Scripts
    wp_register_script('sith-scripts', get_template_directory_uri() . '/js/sith-scripts-frontend.js', array('jquery'), false, true);
    wp_register_script('fnp-nav', get_template_directory_uri() . '/js/fnp-nav.js', array('jquery'), false, true);
    ## Get Global Scripts
    wp_enqueue_script('sith-scripts');
    wp_enqueue_script('fnp-nav');
    ## For facebook & Google + share
    if (is_singular() && sith_get_option('post_og_cards') && (!function_exists('bp_current_component') || function_exists('bp_current_component') && !bp_current_component())) {
        sith_og_data();
    }
}
开发者ID:klebercarvalho,项目名称:demo,代码行数:16,代码来源:header-styles-scripts.php


示例18: friends_screen_requests

/**
 * Catch and process the Requests page.
 */
function friends_screen_requests()
{
    if (bp_is_action_variable('accept', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_accept_friendship');
        if (friends_accept_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship accepted', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be accepted', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('reject', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_reject_friendship');
        if (friends_reject_friendship(bp_action_variable(1))) {
            bp_core_add_message(__('Friendship rejected', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship could not be rejected', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    } elseif (bp_is_action_variable('cancel', 0) && is_numeric(bp_action_variable(1))) {
        // Check the nonce
        check_admin_referer('friends_withdraw_friendship');
        if (friends_withdraw_friendship(bp_loggedin_user_id(), bp_action_variable(1))) {
            bp_core_add_message(__('Friendship request withdrawn', 'buddypress'));
        } else {
            bp_core_add_message(__('Friendship request could not be withdrawn', 'buddypress'), 'error');
        }
        bp_core_redirect(trailingslashit(bp_loggedin_user_domain() . bp_current_component() . '/' . bp_current_action()));
    }
    /**
     * Fires before the loading of template for the friends requests page.
     *
     * @since BuddyPress (1.0.0)
     */
    do_action('friends_screen_requests');
    /**
     * Filters the template used to display the My Friends page.
     *
     * @since BuddyPress (1.0.0)
     *
     * @param string $template Path to the friends request template to load.
     */
    bp_core_load_template(apply_filters('friends_template_requests', 'members/single/home'));
}
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:48,代码来源:bp-friends-screens.php


示例19: remove_wpseo_from_buddypress

 function remove_wpseo_from_buddypress($title)
 {
     global $bp, $post;
     if (empty($this->bp_pages)) {
         $this->bp_pages = get_option('bp-pages');
     }
     if (function_exists('bp_is_directory') && bp_is_directory() || in_array($post->ID, $this->bp_pages)) {
         $title = sprintf(_x('%s Directory - %s', 'Directory Title format', 'vibe'), ucfirst(bp_current_component()), get_bloginfo('name'));
     }
     if (function_exists('bp_is_user') && bp_is_user()) {
         //$title = sprintf(_x('%1s group - %2s','Member Name',ucfirst(bp_get_displayed_user_fullname()),get_bloginfo('name')));
         $title = ucfirst(bp_get_displayed_user_fullname()) . ' - ' . get_bloginfo('name');
     }
     if (function_exists('bp_is_group') && bp_is_group()) {
         //$title = sprintf(_x('%1s group - %2s','Group Name',ucfirst(bp_get_current_group_name()),get_bloginfo('name')));
         $title = ucfirst(bp_get_current_group_name()) . ' - ' . get_bloginfo('name');
     }
     return $title;
 }
开发者ID:nikitansk,项目名称:devschool,代码行数:19,代码来源:filters.php


示例20: template_hierarchy

 /**
  * Add template hierarchy to theme compat for registration/activation pages.
  *
  * This is to mirror how WordPress has
  * {@link https://codex.wordpress.org/Template_Hierarchy template hierarchy}.
  *
  * @since 1.8.0
  *
  * @param string $templates The templates from bp_get_theme_compat_templates().
  * @return array $templates Array of custom templates to look for.
  */
 public function template_hierarchy($templates)
 {
     $component = sanitize_file_name(bp_current_component());
     /**
      * Filters the template hierarchy for theme compat and registration/activation pages.
      *
      * This filter is a variable filter that depends on the current component
      * being used.
      *
      * @since 1.8.0
      *
      * @param array $value Array of template paths to add to hierarchy.
      */
     $new_templates = apply_filters("bp_template_hierarchy_{$component}", array("members/index-{$component}.php"));
     // Merge new templates with existing stack
     // @see bp_get_theme_compat_templates().
     $templates = array_merge((array) $new_templates, $templates);
     return $templates;
 }
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:30,代码来源:class-bp-registration-theme-compat.php



注:本文中的bp_current_component函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP bp_current_item函数代码示例发布时间:2022-05-24
下一篇:
PHP bp_current_action函数代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap