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


PHP bp_members_directory_permalink函数代码示例

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


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

示例1: widget

    /**
     * Display the widget.
     *
     * @param array $args Widget arguments.
     * @param array $instance The widget settings, as saved by the user.
     */
    function widget($args, $instance)
    {
        extract($args);
        if (!bp_displayed_user_id()) {
            return;
        }
        $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
        wp_enqueue_script('bp_core_widget_friends-js', buddypress()->plugin_url . "bp-friends/js/widget-friends{$min}.js", array('jquery'), bp_get_version());
        $user_id = bp_displayed_user_id();
        $link = trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug());
        $instance['title'] = sprintf(__('%s’s Friends', 'buddypress'), bp_get_displayed_user_fullname());
        if (empty($instance['friend_default'])) {
            $instance['friend_default'] = 'active';
        }
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        $title = $instance['link_title'] ? '<a href="' . esc_url($link) . '">' . esc_html($title) . '</a>' : esc_html($title);
        echo $before_title . $title . $after_title;
        $members_args = array('user_id' => absint($user_id), 'type' => sanitize_text_field($instance['friend_default']), 'max' => absint($instance['max_friends']), 'populate_extras' => 1);
        ?>

		<?php 
        if (bp_has_members($members_args)) {
            ?>
			<div class="item-options" id="friends-list-options">
				<a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="newest-friends" <?php 
            if ($instance['friend_default'] == 'newest') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Newest', 'buddypress');
            ?>
</a>
				| <a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="recently-active-friends" <?php 
            if ($instance['friend_default'] == 'active') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Active', 'buddypress');
            ?>
</a>
				| <a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="popular-friends" <?php 
            if ($instance['friend_default'] == 'popular') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Popular', 'buddypress');
            ?>
</a>
			</div>

			<ul id="friends-list" class="item-list">
				<?php 
            while (bp_members()) {
                bp_the_member();
                ?>
					<li class="vcard">
						<div class="item-avatar">
							<a href="<?php 
                bp_member_permalink();
                ?>
" title="<?php 
                bp_member_name();
                ?>
"><?php 
                bp_member_avatar();
                ?>
</a>
						</div>

						<div class="item">
							<div class="item-title fn"><a href="<?php 
                bp_member_permalink();
                ?>
" title="<?php 
                bp_member_name();
                ?>
"><?php 
                bp_member_name();
//.........这里部分代码省略.........
开发者ID:danielcoats,项目名称:schoolpress,代码行数:101,代码来源:bp-friends-widgets.php

示例2: bp_directory_members_search_form

	<div id="members-dir-search" class="dir-search" role="search">
		<?php 
bp_directory_members_search_form();
?>
	</div><!-- #members-dir-search -->

	<?php 
do_action('bp_before_directory_members_tabs');
?>

	<form action="" method="post" id="members-directory-form" class="dir-form">

		<div class="item-list-tabs" id="object-nav" role="navigation">
			<ul>
				<li class="selected" id="members-all"><a href="<?php 
bp_members_directory_permalink();
?>
"><?php 
printf(__('All Members <span>%s</span>', 'buddypress'), bp_get_total_member_count());
?>
</a></li>

				<?php 
if (is_user_logged_in() && bp_is_active('friends') && bp_get_total_friend_count(bp_loggedin_user_id())) {
    ?>
					<li id="members-personal"><a href="<?php 
    echo bp_loggedin_user_domain() . bp_get_friends_slug() . '/my-friends/';
    ?>
"><?php 
    printf(__('My Friends <span>%s</span>', 'buddypress'), bp_get_total_friend_count(bp_loggedin_user_id()));
    ?>
开发者ID:justinwool,项目名称:vortago,代码行数:31,代码来源:index.php

示例3: widget

    /**
     * Display the Members widget.
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    function widget($args, $instance)
    {
        extract($args);
        if (!$instance['member_default']) {
            $instance['member_default'] = 'active';
        }
        $title = apply_filters('widget_title', $instance['title']);
        echo $before_widget;
        $title = $instance['link_title'] ? '<a href="' . trailingslashit(bp_get_root_domain() . '/' . bp_get_members_root_slug()) . '">' . $title . '</a>' : $title;
        echo $before_title . $title . $after_title;
        $members_args = array('user_id' => 0, 'type' => $instance['member_default'], 'per_page' => $instance['max_members'], 'max' => $instance['max_members'], 'populate_extras' => true, 'search_terms' => false);
        ?>

		<?php 
        if (bp_has_members($members_args)) {
            ?>
			<div class="item-options" id="members-list-options">
				<a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="newest-members" <?php 
            if ($instance['member_default'] == 'newest') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Newest', 'buddypress');
            ?>
</a>
				|  <a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="recently-active-members" <?php 
            if ($instance['member_default'] == 'active') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Active', 'buddypress');
            ?>
</a>

				<?php 
            if (bp_is_active('friends')) {
                ?>

					| <a href="<?php 
                bp_members_directory_permalink();
                ?>
" id="popular-members" <?php 
                if ($instance['member_default'] == 'popular') {
                    ?>
class="selected"<?php 
                }
                ?>
><?php 
                _e('Popular', 'buddypress');
                ?>
</a>

				<?php 
            }
            ?>
			</div>

			<ul id="members-list" class="item-list">
				<?php 
            while (bp_members()) {
                bp_the_member();
                ?>
					<li class="vcard">
						<div class="item-avatar">
							<a href="<?php 
                bp_member_permalink();
                ?>
" title="<?php 
                bp_member_name();
                ?>
"><?php 
                bp_member_avatar();
                ?>
</a>
						</div>

						<div class="item">
							<div class="item-title fn"><a href="<?php 
                bp_member_permalink();
                ?>
" title="<?php 
                bp_member_name();
//.........这里部分代码省略.........
开发者ID:eresyyl,项目名称:mk,代码行数:101,代码来源:bp-core-widgets.php

示例4: widget

    /**
     * Display the Members widget.
     *
     * @since 1.0.3
     *
     * @see WP_Widget::widget() for description of parameters.
     *
     * @param array $args     Widget arguments.
     * @param array $instance Widget settings, as saved by the user.
     */
    public function widget($args, $instance)
    {
        global $members_template;
        // Get widget settings.
        $settings = $this->parse_settings($instance);
        /**
         * Filters the title of the Members widget.
         *
         * @since 1.8.0
         * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $settings The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $settings['title'], $settings, $this->id_base);
        $title = $settings['link_title'] ? '<a href="' . bp_get_members_directory_permalink() . '">' . $title . '</a>' : $title;
        /**
         * Filters the separator of the member widget links.
         *
         * @since 2.4.0
         *
         * @param string $separator Separator string. Default '|'.
         */
        $separator = apply_filters('bp_members_widget_separator', '|');
        // Output before widget HTMl, title (and maybe content before & after it).
        echo $args['before_widget'] . $args['before_title'] . $title . $args['after_title'];
        // Setup args for querying members.
        $members_args = array('user_id' => 0, 'type' => $settings['member_default'], 'per_page' => $settings['max_members'], 'max' => $settings['max_members'], 'populate_extras' => true, 'search_terms' => false);
        // Back up the global.
        $old_members_template = $members_template;
        ?>

		<?php 
        if (bp_has_members($members_args)) {
            ?>

			<div class="item-options" id="members-list-options">
				<a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="newest-members" <?php 
            if ('newest' === $settings['member_default']) {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            esc_html_e('Newest', 'buddypress');
            ?>
</a>
				<span class="bp-separator" role="separator"><?php 
            echo esc_html($separator);
            ?>
</span>
				<a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="recently-active-members" <?php 
            if ('active' === $settings['member_default']) {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            esc_html_e('Active', 'buddypress');
            ?>
</a>

				<?php 
            if (bp_is_active('friends')) {
                ?>
					<span class="bp-separator" role="separator"><?php 
                echo esc_html($separator);
                ?>
</span>
					<a href="<?php 
                bp_members_directory_permalink();
                ?>
" id="popular-members" <?php 
                if ('popular' === $settings['member_default']) {
                    ?>
class="selected"<?php 
                }
                ?>
><?php 
                esc_html_e('Popular', 'buddypress');
                ?>
</a>

//.........这里部分代码省略.........
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:101,代码来源:class-bp-core-members-widget.php

示例5: widget

    /**
     * Display the widget.
     *
     * @since 1.9.0
     *
     * @param array $args Widget arguments.
     * @param array $instance The widget settings, as saved by the user.
     */
    function widget($args, $instance)
    {
        global $members_template;
        extract($args);
        if (!bp_displayed_user_id()) {
            return;
        }
        $user_id = bp_displayed_user_id();
        $link = trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug());
        $instance['title'] = sprintf(__("%s's Friends", 'buddypress'), bp_get_displayed_user_fullname());
        if (empty($instance['friend_default'])) {
            $instance['friend_default'] = 'active';
        }
        /**
         * Filters the Friends widget title.
         *
         * @since 1.8.0
         * @since 2.3.0 Added 'instance' and 'id_base' to arguments passed to filter.
         *
         * @param string $title    The widget title.
         * @param array  $instance The settings for the particular instance of the widget.
         * @param string $id_base  Root ID for all widgets of this type.
         */
        $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base);
        echo $before_widget;
        $title = $instance['link_title'] ? '<a href="' . esc_url($link) . '">' . esc_html($title) . '</a>' : esc_html($title);
        echo $before_title . $title . $after_title;
        $members_args = array('user_id' => absint($user_id), 'type' => sanitize_text_field($instance['friend_default']), 'max' => absint($instance['max_friends']), 'populate_extras' => 1);
        // Back up the global.
        $old_members_template = $members_template;
        ?>

		<?php 
        if (bp_has_members($members_args)) {
            ?>
			<div class="item-options" id="friends-list-options">
				<a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="newest-friends" <?php 
            if ($instance['friend_default'] == 'newest') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Newest', 'buddypress');
            ?>
</a>
				| <a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="recently-active-friends" <?php 
            if ($instance['friend_default'] == 'active') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Active', 'buddypress');
            ?>
</a>
				| <a href="<?php 
            bp_members_directory_permalink();
            ?>
" id="popular-friends" <?php 
            if ($instance['friend_default'] == 'popular') {
                ?>
class="selected"<?php 
            }
            ?>
><?php 
            _e('Popular', 'buddypress');
            ?>
</a>
			</div>

			<ul id="friends-list" class="item-list">
				<?php 
            while (bp_members()) {
                bp_the_member();
                ?>
					<li class="vcard">
						<div class="item-avatar">
							<a href="<?php 
                bp_member_permalink();
                ?>
" title="<?php 
                bp_member_name();
                ?>
"><?php 
                bp_member_avatar();
//.........这里部分代码省略.........
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:101,代码来源:class-bp-core-friends-widget.php

示例6: bp_adminbar_random_menu

/**
 * Output the Random BuddyBar menu.
 *
 * Not visible for logged-in users.
 *
 * @deprecated BuddyPress (2.1.0)
 */
function bp_adminbar_random_menu()
{
    ?>

	<li class="align-right" id="bp-adminbar-visitrandom-menu">
		<a href="#"><?php 
    _e('Visit', 'buddypress');
    ?>
</a>
		<ul class="random-list">
			<li><a href="<?php 
    bp_members_directory_permalink();
    ?>
?random-member" rel="nofollow"><?php 
    _e('Random Member', 'buddypress');
    ?>
</a></li>

			<?php 
    if (bp_is_active('groups')) {
        ?>

				<li class="alt"><a href="<?php 
        bp_groups_directory_permalink();
        ?>
?random-group"  rel="nofollow"><?php 
        _e('Random Group', 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<?php 
    if (is_multisite() && bp_is_active('blogs')) {
        ?>

				<li><a href="<?php 
        bp_blogs_directory_permalink();
        ?>
?random-blog"  rel="nofollow"><?php 
        _e('Random Site', 'buddypress');
        ?>
</a></li>

			<?php 
    }
    ?>

			<?php 
    do_action('bp_adminbar_random_menu');
    ?>

		</ul>
	</li>

	<?php 
}
开发者ID:kosir,项目名称:thatcamp-org,代码行数:66,代码来源:2.1.php


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