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


PHP bp_button函数代码示例

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


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

示例1: editor

 /**
  * Display the button to launch the Editor
  *
  * @since Rendez Vous (1.0.0)
  */
 public static function editor($editor_id, $settings = array())
 {
     $set = self::set($editor_id, $settings);
     $load_editor = apply_filters('rendez_vous_load_editor', bp_is_my_profile());
     if (current_user_can('publish_rendez_vouss') && !empty($load_editor)) {
         bp_button(array('id' => 'create-' . $set['component'] . '-' . $set['status'], 'component' => 'rendez_vous', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_id' => $editor_id, 'wrapper_class' => $set['btn_class'], 'link_class' => 'add-' . $set['status'], 'link_href' => '#', 'link_title' => $set['btn_caption'], 'link_text' => $set['btn_caption']));
     }
     self::launch($editor_id);
 }
开发者ID:socialray,项目名称:surfied-2-0,代码行数:14,代码来源:rendez-vous-classes.php

示例2: do_action

        /**
         * Fires inside the groups membership request list loop.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_group_membership_requests_admin_item');
        ?>

				<div class="action">

					<?php 
        bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'buddypress'), 'link_text' => __('Accept', 'buddypress')));
        ?>

					<?php 
        bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'buddypress'), 'link_text' => __('Reject', 'buddypress')));
        ?>

					<?php 
        /**
         * Fires inside the list of membership request actions.
         *
         * @since BuddyPress (1.1.0)
         */
        do_action('bp_group_membership_requests_admin_item_action');
        ?>

				</div>
			</li>

		<?php 
开发者ID:un1coin,项目名称:ovn-space,代码行数:31,代码来源:requests-loop.php

示例3: bp_get_group_new_topic_button

function bp_get_group_new_topic_button($group = false)
{
    global $groups_template;
    if (!$group) {
        $group =& $groups_template->group;
    }
    if (!is_user_logged_in() || bp_group_is_user_banned() || !bp_is_group_forum() || bp_is_group_forum_topic()) {
        return false;
    }
    $button = bp_button(array('id' => 'new_topic', 'component' => 'groups', 'must_be_logged_in' => true, 'block_self' => true, 'wrapper_class' => 'group-button', 'link_href' => '#post-new', 'link_class' => 'group-button show-hide-new', 'link_id' => 'new-topic-button', 'link_text' => __('New Topic', 'buddypress'), 'link_title' => __('New Topic', 'buddypress')));
    // Filter and return the HTML button
    return bp_get_button(apply_filters('bp_get_group_new_topic_button', $button));
}
开发者ID:newington,项目名称:buddypress,代码行数:13,代码来源:bp-groups-template.php

示例4: bp_edit_profile_button

function bp_edit_profile_button()
{
    global $bp;
    bp_button(array('id' => 'edit_profile', 'component' => 'xprofile', 'must_be_logged_in' => true, 'block_self' => true, 'link_href' => trailingslashit($bp->displayed_user->domain . $bp->profile->slug . '/edit'), 'link_class' => 'edit', 'link_text' => __('Edit Profile', 'buddypress'), 'link_title' => __('Edit Profile', 'buddypress')));
}
开发者ID:newington,项目名称:buddypress,代码行数:5,代码来源:bp-xprofile-template.php

示例5: _e

        ?>
" />
				<input type="hidden" name="action" id="action" value="bp_avatar_upload" />
			</p>

			<?php 
        if (bp_get_group_has_avatar()) {
            ?>

				<p><?php 
            _e("If you'd like to remove the existing group profile photo but not upload a new one, please use the delete group profile photo button.", 'buddypress');
            ?>
</p>

				<?php 
            bp_button(array('id' => 'delete_group_avatar', 'component' => 'groups', 'wrapper_id' => 'delete-group-avatar-button', 'link_class' => 'edit', 'link_href' => bp_get_group_avatar_delete_link(), 'link_title' => __('Delete Group Profile Photo', 'buddypress'), 'link_text' => __('Delete Group Profile Photo', 'buddypress')));
            ?>

			<?php 
        }
        ?>

			<?php 
        wp_nonce_field('bp_avatar_upload');
        ?>

	<?php 
    }
    ?>

	<?php 
开发者ID:sdh100shaun,项目名称:pantheon,代码行数:31,代码来源:admin.php

示例6: bp_edit_profile_button

/**
 * Render an edit profile button.
 *
 * @since 1.0.0
 */
function bp_edit_profile_button()
{
    bp_button(array('id' => 'edit_profile', 'component' => 'xprofile', 'must_be_logged_in' => true, 'block_self' => true, 'link_href' => trailingslashit(bp_displayed_user_domain() . bp_get_profile_slug() . '/edit'), 'link_class' => 'edit', 'link_text' => __('Edit Profile', 'buddypress')));
}
开发者ID:CompositeUK,项目名称:clone.BuddyPress,代码行数:9,代码来源:bp-xprofile-template.php

示例7: add_activity_comment_spam_button

 /**
  * Adds a "mark as spam" button to each activity COMMENT item for site admins.
  *
  * This function is intended to be used inside the activity stream loop.
  *
  * @since BuddyPress (1.6)
  */
 public function add_activity_comment_spam_button()
 {
     if (!bp_activity_user_can_mark_spam()) {
         return;
     }
     // By default, only handle activity updates and activity comments.
     $current_comment = bp_activity_current_comment();
     if (empty($current_comment) || !in_array($current_comment->type, BP_Akismet::get_activity_types())) {
         return;
     }
     bp_button(array('block_self' => false, 'component' => 'activity', 'id' => 'activity_make_spam_' . bp_get_activity_comment_id(), 'link_class' => 'bp-secondary-action spam-activity-comment confirm', 'link_href' => wp_nonce_url(bp_get_root_domain() . '/' . bp_get_activity_slug() . '/spam/' . bp_get_activity_comment_id() . '/?cid=' . bp_get_activity_comment_id(), 'bp_activity_akismet_spam_' . bp_get_activity_comment_id()), 'link_text' => __('Spam', 'buddypress'), 'wrapper' => false));
 }
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:19,代码来源:bp-activity-akismet.php

示例8: bp_group_new_topic_button

function bp_group_new_topic_button() {
	if ( bp_is_group_forum() && is_user_logged_in() && !bp_is_group_forum_topic() ) {
		bp_button( array (
			'id'                => 'new_topic',
			'component'         => 'groups',
			'must_be_logged_in' => true,
			'block_self'        => true,
			'wrapper_class'     => 'group-button',
			'link_href'         => '#post-new',
			'link_class'        => '',
			'link_text'         => __( 'New Topic', 'buddypress' ),
			'link_title'        => __( 'New Topic', 'buddypress' ),
		) );
	}
}
开发者ID:n-sane,项目名称:zaroka,代码行数:15,代码来源:bp-groups-templatetags.php

示例9: bp_group_request_time_since_requested

        bp_group_request_time_since_requested();
        ?>
</span>

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

				<div class="action">

					<?php 
        bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_class' => 'btn btn-default', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'firmasite'), 'link_text' => __('Accept', 'firmasite')));
        ?>

					<?php 
        bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_class' => 'btn btn-default', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'firmasite'), 'link_text' => __('Reject', 'firmasite')));
        ?>

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

				</div>
             </div></div>     
			</li>

		<?php 
    }
    ?>
	</ul>
开发者ID:jason-herndon,项目名称:bas-intranet,代码行数:30,代码来源:requests-loop.php

示例10: bp_group_request_time_since_requested

            echo $user->block;
            ?>
				</div>
				
				<div class="directory-content">
					<header class="activity-header">	
						<p class="activity"><?php 
            bp_group_request_time_since_requested();
            ?>
</p>
						<div class="actions">
							<?php 
            bp_button(array('id' => 'group_membership_accept', 'component' => 'groups', 'wrapper_class' => 'accept', 'link_href' => bp_get_group_request_accept_link(), 'link_title' => __('Accept', 'buddypress'), 'link_class' => 'button', 'link_text' => '<i class="fa fa-check"></i>Accept', 'wrapper' => false));
            ?>
							<?php 
            bp_button(array('id' => 'group_membership_reject', 'component' => 'groups', 'wrapper_class' => 'reject', 'link_href' => bp_get_group_request_reject_link(), 'link_title' => __('Reject', 'buddypress'), 'link_class' => 'button', 'link_text' => '<i class="fa fa-remove"></i>Reject', 'wrapper' => false));
            ?>
						</div>
					</header>

					<blockquote class="activity-content">
						<?php 
            bp_group_request_comment();
            ?>
					</blockquote>
				</div>
			</li>		
			<?php 
        }
        ?>
		</ul>
开发者ID:tamriel-foundry,项目名称:apoc2,代码行数:31,代码来源:admin.php

示例11: bp_follow_activity_button

/**
 * Output a 'Follow' activity button.
 *
 * @param $args {
 *      Array of arguments.  Also see other args via {@link BP_Button} class.
 *      @type int  $leader_id           Activity ID to follow.
 *      @type int  $follower_id         User ID initiating the follow request.
 *      @type bool $show_follower_count Should we show the follower count for this item? Default: false.
 * }
 */
function bp_follow_activity_button($args = array())
{
    global $activities_template;
    $r = bp_parse_args($args, array('leader_id' => !empty($activities_template->in_the_loop) ? bp_get_activity_id() : 0, 'follower_id' => bp_loggedin_user_id(), 'link_text' => '', 'link_title' => '', 'wrapper_class' => '', 'link_class' => 'button bp-primary-action', 'wrapper' => false, 'show_follower_count' => false), 'follow_activity_button');
    if (!$r['leader_id'] || !$r['follower_id']) {
        return;
    }
    $follow_type = bp_follow_activity_get_type($r['leader_id']);
    // if we're checking during an activity loop, then follow status is already
    // queried via bulk_inject_follow_activity_status()
    if (!empty($activities_template->in_the_loop) && $r['follower_id'] == bp_loggedin_user_id() && $r['leader_id'] == bp_get_activity_id() && 'activity' === $follow_type) {
        $is_following = $activities_template->activity->is_following;
        // else we manually query the follow status
    } else {
        $is_following = bp_follow_is_following(array('leader_id' => $r['leader_id'], 'follower_id' => $r['follower_id'], 'follow_type' => $follow_type));
    }
    // setup some variables
    if ($is_following) {
        $id = 'following';
        $action = 'unfollow';
        /* @todo Maybe bring back the count for the 'unfollow' button?
        		$count  = bp_follow_get_the_followers_count( array(
        			'object_id'   => $r['leader_id'],
        			'follow_type' => $follow_type
        		) );
        		*/
        $count = 0;
        if (empty($count)) {
            $link_text = _x('Unfollow', 'Follow activity button', 'bp-follow');
        } else {
            $link_text = sprintf(_x('Unfollow %s', 'Follow activity button', 'bp-follow'), '<span>' . $count . '</span>');
        }
        if (empty($r['link_text'])) {
            $r['link_text'] = $link_text;
        }
    } else {
        $id = 'not-following';
        $action = 'follow';
        $count = 0;
        if (true === $r['show_follower_count']) {
            $count = bp_follow_get_the_followers_count(array('object_id' => $r['leader_id'], 'follow_type' => $follow_type));
        }
        if (empty($count)) {
            $link_text = _x('Follow', 'Follow activity button', 'bp-follow');
        } else {
            $link_text = sprintf(_x('Follow %s', 'Follow activity button', 'bp-follow'), '<span>' . $count . '</span>');
        }
        if (empty($r['link_text'])) {
            $r['link_text'] = $link_text;
        }
    }
    $wrapper_class = 'follow-button ' . $id;
    if (!empty($r['wrapper_class'])) {
        $wrapper_class .= ' ' . esc_attr($r['wrapper_class']);
    }
    $link_class = $action;
    if (!empty($r['link_class'])) {
        $link_class .= ' ' . esc_attr($r['link_class']);
    }
    // setup the button arguments
    $button = array('id' => $id, 'component' => 'follow', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_class' => $wrapper_class, 'wrapper_id' => 'follow-button-' . (int) $r['leader_id'], 'link_href' => wp_nonce_url(trailingslashit(bp_get_activity_directory_permalink() . $action . '/' . esc_attr($r['leader_id'])), "bp_follow_activity_{$action}"), 'link_text' => $r['link_text'], 'link_title' => esc_attr($r['link_title']), 'link_id' => $action . '-' . (int) $r['leader_id'], 'link_class' => $link_class, 'wrapper' => !empty($r['wrapper']) ? esc_attr($r['wrapper']) : false);
    // Filter and output the HTML button
    bp_button(apply_filters('bp_follow_activity_get_follow_button', $button, $r, $is_following));
}
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:74,代码来源:activity-functions.php

示例12: cacsp_add_button

/**
 * Template tag to add a button.
 *
 * @param string $type The type of button. Either 'delete' or 'publish'.
 */
function cacsp_add_button($type = 'delete')
{
    $r = array('id' => "bpsp-{$type}", 'component' => 'members', 'must_be_logged_in' => true, 'block_self' => false, 'link_text' => 'delete' == $type ? __('Delete', 'social-paper') : __('Publish', 'social-paper'), 'wrapper_class' => 'paper-button', 'link_class' => 'paper-button');
    // add confirm class just so user can confirm the choice
    if ('delete' === $type) {
        $r['link_class'] .= ' confirm';
    }
    $r['link_href'] = wp_nonce_url(trailingslashit(bp_loggedin_user_domain() . 'papers/' . esc_attr($type) . '/' . get_post()->ID), "bp_social_paper_{$type}", "bpsp-{$type}");
    // Output button
    bp_button(apply_filters('bp_social_paper_button_args', $r));
}
开发者ID:sheesh,项目名称:social-paper,代码行数:16,代码来源:hooks-buddypress-profile.php

示例13: rendez_vous_single_title

/**
 * Single screen title
 *
 * @package Rendez Vous
 * @subpackage Parts
 *
 * @since Rendez Vous (1.0.0)
 */
function rendez_vous_single_title()
{
    rendez_vous_single_the_title();
    if (current_user_can('edit_rendez_vous', rendez_vous_single_get_the_id())) {
        bp_button(array('id' => 'edit-rendez-vous', 'component' => 'rendez_vous', 'must_be_logged_in' => true, 'block_self' => false, 'wrapper_id' => 'rendez-vous-edit-btn', 'wrapper_class' => 'right', 'link_class' => 'edit-rendez-vous', 'link_href' => rendez_vous_single_get_edit_link(), 'link_title' => __('Edit', 'rendez-vous'), 'link_text' => __('Edit', 'rendez-vous')));
    }
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:15,代码来源:rendez-vous-parts.php


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