当前位置: 首页>>代码示例>>PHP>>正文


PHP bp_get_template_part函数代码示例

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


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

示例1: wplms_dashboard_template

function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    global $bp;
    if ($bp->current_component == 'dashboard') {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery', 'jquery-ui-sortable'), '1.0');
        if (is_active_widget(false, false, 'wplms_instructor_dash_stats', true) || is_active_widget(false, false, 'wplms_dash_stats', true)) {
            wp_enqueue_script('wplms-sparkline', WPLMS_DASHBOARD_URL . '/js/jquery.sparkline.min.js', array('jquery'), true);
        }
        if (is_active_widget(false, false, 'wplms_instructor_stats', true) || is_active_widget(false, false, 'wplms_instructor_commission_stats', true) || is_active_widget(false, false, 'wplms_student_stats', true)) {
            wp_enqueue_script('wplms-raphael', WPLMS_DASHBOARD_URL . '/js/raphael-min.js', array('jquery'), true);
            wp_enqueue_script('wplms-morris', WPLMS_DASHBOARD_URL . '/js/morris.min.js', array('jquery'), true);
        }
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:27,代码来源:functions.php

示例2: social_articles_load_sub_template

function social_articles_load_sub_template($template)
{
    if (empty($template)) {
        return false;
    }
    if (bp_sa_is_bp_default()) {
        //locate_template( array(  $template . '.php' ), true );
        if ($located_template = apply_filters('bp_located_template', locate_template($template, false), $template)) {
            load_template(apply_filters('bp_load_template', $located_template));
        }
    } else {
        bp_get_template_part($template);
    }
}
开发者ID:Dannypid,项目名称:Tinymce-social-articles-1.8,代码行数:14,代码来源:social-articles-functions.php

示例3: display

 public function display($group_id = null)
 {
     // Template location is handled via the template stack. see ccgn_load_template_filter()
     bp_get_template_part('groups/single/narratives');
     // if( bcg_is_single_post() ) {
     //   echo "is single post";
     //   bp_get_template_part( 'ccgn/single-post.php' );
     // } else if( bcg_is_post_create() ) {
     //   echo "is create";
     //   bp_get_template_part( 'ccgn/create.php' );
     // } else {
     //   echo "is list";
     //   bp_get_template_part( 'ccgn/narrative-list.php' );
     // }
 }
开发者ID:careshub,项目名称:cc-group-narratives,代码行数:15,代码来源:class-bp-group-extension.php

示例4: wplms_dashboard_template

function wplms_dashboard_template()
{
    if (!is_user_logged_in()) {
        wp_redirect(site_url());
    }
    $template = 'templates/dashboard';
    if (function_exists('bp_is_my_profile') && bp_is_my_profile()) {
        wp_enqueue_style('wplms-dashboard-css', WPLMS_DASHBOARD_URL . '/css/wplms-dashboard.css', array(), '1.0');
        wp_enqueue_script('wplms-dashboard-js', WPLMS_DASHBOARD_URL . '/js/wplms-dashboard.js', array('jquery'), '1.0');
        $translation_array = array('earnings' => __('Earnings', 'wplms-dashboard'), 'payout' => __('Payout', 'wplms-dashboard'), 'students' => __('# Students', 'wplms-dashboard'), 'saved' => __('SAVED', 'wplms-dashboard'), 'saving' => __('SAVING ...', 'wplms-dashboard'), 'stats_calculated' => __('Stats Calculated, reloading page ...', 'wplms-dashboard'));
        wp_localize_script('wplms-dashboard-js', 'wplms_dashboard_strings', $translation_array);
    }
    $located_template = apply_filters('bp_located_template', locate_template($template, false), $template);
    if ($located_template && $located_template != '') {
        bp_get_template_part(apply_filters('bp_load_template', $located_template));
    } else {
        bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/dashboard'));
    }
}
开发者ID:Nguyenkain,项目名称:Elearning,代码行数:19,代码来源:functions.php

示例5: training_wpo_buddypress_group_header

    function training_wpo_buddypress_group_header()
    {
        global $groups_template;
        ?>
	<div id="item-header" class="pb-group pb-item-header" role="complementary">
		<div class="container">
				<?php 
        if (bp_has_groups()) {
            while (bp_groups()) {
                bp_the_group();
                ?>
				<?php 
                bp_get_template_part('groups/single/group-header');
                ?>
			<?php 
            }
        }
        ?>
		</div>
	</div><!-- #item-header -->


<?php 
    }
开发者ID:morganloehr,项目名称:chris-verna,代码行数:24,代码来源:function.php

示例6: bp_groups_members_template_part

/**
 * Output the Group members template
 *
 * @since BuddyPress (?)
 *
 * @return string html output
 */
function bp_groups_members_template_part()
{
    ?>
	<div class="item-list-tabs" id="subnav" role="navigation">
		<ul>
			<li class="groups-members-search" role="search">
				<?php 
    bp_directory_members_search_form();
    ?>
			</li>

			<?php 
    bp_groups_members_filter();
    ?>
			<?php 
    do_action('bp_members_directory_member_sub_types');
    ?>

		</ul>
	</div>

	<div id="members-group-list" class="group_members dir-list">

		<?php 
    bp_get_template_part('groups/single/members');
    ?>

	</div>
	<?php 
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:37,代码来源:bp-groups-template.php

示例7: bp_get_template_part

    bp_get_template_part('activity/post-form');
}
/**
 * Fires after the display of the member activity post form.
 *
 * @since BuddyPress (1.2.0)
 */
do_action('bp_after_member_activity_post_form');
/**
 * Fires before the display of the member activities list.
 *
 * @since BuddyPress (1.2.0)
 */
do_action('bp_before_member_activity_content');
?>

<div class="activity">

	<?php 
bp_get_template_part('activity/activity-loop');
?>

</div><!-- .activity -->

<?php 
/**
 * Fires after the display of the member activities list.
 *
 * @since BuddyPress (1.2.0)
 */
do_action('bp_after_member_activity_content');
开发者ID:kosir,项目名称:thatcamp-org,代码行数:31,代码来源:activity.php

示例8: bp_groups_members_template_part

/**
 * Output the Group members template
 *
 * @since 2.0.0
 */
function bp_groups_members_template_part()
{
    ?>
	<div class="item-list-tabs" id="subnav" role="navigation">
		<ul>
			<li class="groups-members-search" role="search">
				<?php 
    bp_directory_members_search_form();
    ?>
			</li>

			<?php 
    bp_groups_members_filter();
    ?>
			<?php 
    /**
     * Fires at the end of the group members search unordered list.
     *
     * Part of bp_groups_members_template_part().
     *
     * @since 1.5.0
     */
    do_action('bp_members_directory_member_sub_types');
    ?>

		</ul>
	</div>

	<div id="members-group-list" class="group_members dir-list">

		<?php 
    bp_get_template_part('groups/single/members');
    ?>

	</div>
	<?php 
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:42,代码来源:bp-groups-template.php

示例9: do_action

		<?php 
    /**
     * Fires before the display of the message thread list.
     *
     * @since 1.1.0
     */
    do_action('bp_before_message_thread_list');
    ?>

		<?php 
    while (bp_thread_messages()) {
        bp_thread_the_message();
        ?>
			<?php 
        bp_get_template_part('members/single/messages/message');
        ?>
		<?php 
    }
    ?>

		<?php 
    /**
     * Fires after the display of the message thread list.
     *
     * @since 1.1.0
     */
    do_action('bp_after_message_thread_list');
    ?>

		<?php 
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:30,代码来源:single.php

示例10: while

<?php 
if (sq_option('bp_full_group', 0) == 1 && bp_is_single_item() && bp_is_groups_component()) {
    ?>

    <?php 
    if (bp_has_groups()) {
        while (bp_groups()) {
            bp_the_group();
            ?>

    <section class="alternate-color bp-full-width-profile">
        <div id="item-header" role="complementary">

            <?php 
            bp_get_template_part('groups/single/group-header');
            ?>

        </div>
        <!-- #item-header -->
    </section>

     <?php 
        }
    }
    ?>

<?php 
}
?>
开发者ID:quyip8818,项目名称:wps,代码行数:29,代码来源:buddypress.php

示例11: bp_get_template_part

	
  <div class="read-notifications">
		<?php 
    bp_get_template_part('members/single/notifications/notifications-loop');
    ?>
  </div>

	<div id="pag-bottom" class="pagination no-ajax">
		<div class="pag-count" id="notifications-count-bottom">
			<?php 
    bp_notifications_pagination_count();
    ?>
		</div>

		<div class="pagination-links" id="notifications-pag-bottom">
			<?php 
    bp_notifications_pagination_links();
    ?>
		</div>
	</div>

<?php 
} else {
    ?>

	<?php 
    bp_get_template_part('members/single/notifications/feedback-no-notifications');
    ?>

<?php 
}
开发者ID:6226,项目名称:wp,代码行数:30,代码来源:read.php

示例12: buddydrive_get_template

/**
 * Chooses the best way to load BuddyDrive templates
 *
 * @param string $template the template needed
 * @param boolean $require_once if we need to load it only once or more
 * @uses buddydrive_is_bp_default() to check for BP Default
 * @uses load_template()
 * @uses bp_get_template_part()
 */
function buddydrive_get_template($template = false, $require_once = true)
{
    if (empty($template)) {
        return false;
    }
    if (buddydrive_is_bp_default()) {
        $template = $template . '.php';
        if (file_exists(STYLESHEETPATH . '/' . $template)) {
            $filtered_templates = STYLESHEETPATH . '/' . $template;
        } else {
            $filtered_templates = buddydrive_get_plugin_dir() . '/templates/' . $template;
        }
        load_template(apply_filters('buddydrive_get_template', $filtered_templates), $require_once);
    } else {
        bp_get_template_part($template);
    }
}
开发者ID:MrVibe,项目名称:buddydrive,代码行数:26,代码来源:buddydrive-item-screens.php

示例13: bp_activity_heartbeat_last_recorded

/**
 * Use WordPress Heartbeat API to check for latest activity update.
 *
 * @since 2.0.0
 *
 * @uses bp_activity_get_last_updated() to get the recorded date of the last activity.
 *
 * @param array $response Array containing Heartbeat API response.
 * @param array $data     Array containing data for Heartbeat API response.
 * @return array $response
 */
function bp_activity_heartbeat_last_recorded($response = array(), $data = array())
{
    if (empty($data['bp_activity_last_recorded'])) {
        return $response;
    }
    // Use the querystring argument stored in the cookie (to preserve
    // filters), but force the offset to get only new items.
    $activity_latest_args = bp_parse_args(bp_ajax_querystring('activity'), array('since' => date('Y-m-d H:i:s', $data['bp_activity_last_recorded'])), 'activity_latest_args');
    if (!empty($data['bp_activity_last_recorded_search_terms']) && empty($activity_latest_args['search_terms'])) {
        $activity_latest_args['search_terms'] = addslashes($data['bp_activity_last_recorded_search_terms']);
    }
    $newest_activities = array();
    $last_activity_recorded = 0;
    // Temporarily add a just-posted class for new activity items.
    add_filter('bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1);
    ob_start();
    if (bp_has_activities($activity_latest_args)) {
        while (bp_activities()) {
            bp_the_activity();
            $atime = strtotime(bp_get_activity_date_recorded());
            if ($last_activity_recorded < $atime) {
                $last_activity_recorded = $atime;
            }
            bp_get_template_part('activity/entry');
        }
    }
    $newest_activities['activities'] = ob_get_contents();
    $newest_activities['last_recorded'] = $last_activity_recorded;
    ob_end_clean();
    // Remove the temporary filter.
    remove_filter('bp_get_activity_css_class', 'bp_activity_newest_class', 10, 1);
    if (!empty($newest_activities['last_recorded'])) {
        $response['bp_activity_newest_activities'] = $newest_activities;
    }
    return $response;
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:47,代码来源:bp-activity-filters.php

示例14: bp_legacy_theme_new_activity_comment

/**
 * Posts new Activity comments received via a POST request.
 *
 * @global BP_Activity_Template $activities_template
 * @return string HTML
 * @since BuddyPress (1.2)
 */
function bp_legacy_theme_new_activity_comment()
{
    global $activities_template;
    // Bail if not a POST action
    if ('POST' !== strtoupper($_SERVER['REQUEST_METHOD'])) {
        return;
    }
    // Check the nonce
    check_admin_referer('new_activity_comment', '_wpnonce_new_activity_comment');
    if (!is_user_logged_in()) {
        exit('-1');
    }
    if (empty($_POST['content'])) {
        exit('-1<div id="message" class="error"><p>' . __('Please do not leave the comment area blank.', 'buddypress') . '</p></div>');
    }
    if (empty($_POST['form_id']) || empty($_POST['comment_id']) || !is_numeric($_POST['form_id']) || !is_numeric($_POST['comment_id'])) {
        exit('-1<div id="message" class="error"><p>' . __('There was an error posting that reply, please try again.', 'buddypress') . '</p></div>');
    }
    $comment_id = bp_activity_new_comment(array('activity_id' => $_POST['form_id'], 'content' => $_POST['content'], 'parent_id' => $_POST['comment_id']));
    if (!$comment_id) {
        exit('-1<div id="message" class="error"><p>' . __('There was an error posting that reply, please try again.', 'buddypress') . '</p></div>');
    }
    // Load the new activity item into the $activities_template global
    bp_has_activities('display_comments=stream&hide_spam=false&include=' . $comment_id);
    // Swap the current comment with the activity item we just loaded
    if (isset($activities_template->activities[0])) {
        $activities_template->activity = new stdClass();
        $activities_template->activity->id = $activities_template->activities[0]->item_id;
        $activities_template->activity->current_comment = $activities_template->activities[0];
    }
    // get activity comment template part
    bp_get_template_part('activity/comment');
    unset($activities_template);
    exit;
}
开发者ID:davidHuanghw,项目名称:david_blog,代码行数:42,代码来源:buddypress-functions.php

示例15: do_action

<section id="content">
	<div id="buddypress">
		<div class="member_header">
			<?php 
/**
 * Fires before the display of member home content.
 *
 * @since BuddyPress (1.2.0)
 */
do_action('bp_before_member_home_content');
?>

			<div id="item-header" role="complementary">
				<?php 
bp_get_template_part('members/single/member-header');
?>
			</div>
		</div><!-- #item-header -->
		<div id="item-nav" class="">
			<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
				<div class="container">
					<div class="col-md-9 col-md-offset-3">
						<ul>

							<?php 
bp_get_displayed_user_nav();
?>

							<?php 
do_action('bp_member_options_nav');
开发者ID:nikitansk,项目名称:devschool,代码行数:30,代码来源:plugins.php


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