本文整理汇总了PHP中bp_is_action_variable函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_is_action_variable函数的具体用法?PHP bp_is_action_variable怎么用?PHP bp_is_action_variable使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_is_action_variable函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: 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
示例2: 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
示例3: bp_groupblog_add_js
/**
* bp_groupblog_add_js()
*/
function bp_groupblog_add_js()
{
if (bp_is_groups_component() && bp_is_action_variable('group-blog')) {
if (file_exists(get_stylesheet_directory() . '/groupblog/js/general.js')) {
wp_enqueue_script('bp-groupblog-js', get_stylesheet_directory_uri() . '/groupblog/js/general.js', array('jquery'));
} else {
wp_enqueue_script('bp-groupblog-js', plugins_url() . '/bp-groupblog/groupblog/js/general.js', array('jquery'));
}
}
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:13,代码来源:bp-groupblog-cssjs.php
示例4: bp_example_high_five_save
/**
* Check to see if a high five is being given, and if so, save it.
*
* Hooked to bp_actions, this function will fire before the screen function. We use our function
* bp_is_example_component(), along with the bp_is_current_action() and bp_is_action_variable()
* functions, to detect (based on the requested URL) whether the user has clicked on "send high
* five". If so, we do a bit of simple logic to see what should happen next.
*
* @package BuddyPress_Skeleton_Component
* @since 1.6
*/
function bp_example_high_five_save()
{
if (bp_is_example_component() && bp_is_current_action('screen-one') && bp_is_action_variable('send-h5', 0)) {
// The logged in user has clicked on the 'send high five' link
if (bp_is_my_profile()) {
// Don't let users high five themselves
bp_core_add_message(__('No self-fives! :)', 'bp-example'), 'error');
} else {
if (bp_example_send_highfive(bp_displayed_user_id(), bp_loggedin_user_id())) {
bp_core_add_message(__('High-five sent!', 'bp-example'));
} else {
bp_core_add_message(__('High-five could not be sent.', 'bp-example'), 'error');
}
}
bp_core_redirect(bp_displayed_user_domain() . bp_get_example_slug() . '/screen-one');
}
}
开发者ID:natrio,项目名称:buddypress-skeleton-component,代码行数:28,代码来源:bp-example-actions.php
示例5: xprofile_action_delete_avatar
/**
* This function runs when an action is set for a screen:
* example.com/members/andy/profile/change-avatar/ [delete-avatar]
*
* The function will delete the active avatar for a user.
*
* @package BuddyPress Xprofile
* @uses bp_core_delete_avatar() Deletes the active avatar for the logged in user.
* @uses add_action() Runs a specific function for an action when it fires.
*/
function xprofile_action_delete_avatar()
{
if (!bp_is_user_change_avatar() || !bp_is_action_variable('delete-avatar', 0)) {
return false;
}
// Check the nonce
check_admin_referer('bp_delete_avatar_link');
if (!bp_is_my_profile() && !bp_current_user_can('bp_moderate')) {
return false;
}
if (bp_core_delete_existing_avatar(array('item_id' => bp_displayed_user_id()))) {
bp_core_add_message(__('Your avatar was deleted successfully!', 'buddypress'));
} else {
bp_core_add_message(__('There was a problem deleting that avatar, please try again.', 'buddypress'), 'error');
}
bp_core_redirect(wp_get_referer());
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:27,代码来源:bp-xprofile-actions.php
示例6: 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
示例7: get_current_view
/**
* Sets up the current view when viewing a user page
*
* @since 1.2
*/
function get_current_view($view, $item_type)
{
global $wp_rewrite;
if ($item_type == 'user') {
$current_action = bp_current_action();
if (empty($current_action) || in_array($current_action, array(BP_DOCS_STARTED_SLUG, BP_DOCS_EDITED_SLUG))) {
// An empty $bp->action_variables[0] means that you're looking at a list.
// A url like members/terry/docs/started/page/3 also means you're looking at a list.
$view = 'list';
} else {
if ($current_action == BP_DOCS_CATEGORY_SLUG) {
// Category view
$view = 'category';
} else {
if ($current_action == BP_DOCS_CREATE_SLUG) {
// Create new doc
$view = 'create';
} else {
if (!bp_action_variable(0)) {
// $bp->action_variables[1] is the slug for this doc. If there's no
// further chunk, then we're attempting to view a single item
$view = 'single';
} else {
if (bp_is_action_variable(BP_DOCS_EDIT_SLUG, 0)) {
// This is an edit page
$view = 'edit';
} else {
if (bp_is_action_variable(BP_DOCS_DELETE_SLUG, 0)) {
// This is an delete request
$view = 'delete';
} else {
if (bp_is_action_variable(BP_DOCS_HISTORY_SLUG, 0)) {
// This is a history request
$view = 'history';
}
}
}
}
}
}
}
}
return $view;
}
开发者ID:igniterealtime,项目名称:community-plugins,代码行数:49,代码来源:integration-users.php
示例8: messages_action_bulk_delete
function messages_action_bulk_delete()
{
if (!bp_is_messages_component() || !bp_is_action_variable('bulk-delete', 0)) {
return false;
}
$thread_ids = $_POST['thread_ids'];
if (!$thread_ids || !messages_check_thread_access($thread_ids)) {
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
} else {
if (!check_admin_referer('messages_delete_thread')) {
return false;
}
if (!messages_delete_thread($thread_ids)) {
bp_core_add_message(__('There was an error deleting messages.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('Messages deleted.', 'buddypress'));
}
bp_core_redirect(trailingslashit(bp_displayed_user_domain() . bp_get_messages_slug() . '/' . bp_current_action()));
}
}
开发者ID:danielcoats,项目名称:schoolpress,代码行数:20,代码来源:bp-messages-actions.php
示例9: get_current_view
/**
* Sets up the current view when viewing a user page
*
* @since 1.2
*/
function get_current_view($view, $item_type)
{
if ($item_type == 'user') {
if (!bp_current_action()) {
// An empty $bp->action_variables[0] means that you're looking at a list
$view = 'list';
} else {
if (bp_is_current_action(BP_DOCS_CATEGORY_SLUG)) {
// Category view
$view = 'category';
} else {
if (bp_is_current_action(BP_DOCS_CREATE_SLUG)) {
// Create new doc
$view = 'create';
} else {
if (!bp_action_variable(0)) {
// $bp->action_variables[1] is the slug for this doc. If there's no
// further chunk, then we're attempting to view a single item
$view = 'single';
} else {
if (bp_is_action_variable(BP_DOCS_EDIT_SLUG, 0)) {
// This is an edit page
$view = 'edit';
} else {
if (bp_is_action_variable(BP_DOCS_DELETE_SLUG, 0)) {
// This is an delete request
$view = 'delete';
} else {
if (bp_is_action_variable(BP_DOCS_HISTORY_SLUG, 0)) {
// This is a history request
$view = 'history';
}
}
}
}
}
}
}
}
return $view;
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:46,代码来源:integration-users.php
示例10: view_single
public function view_single()
{
$bp = buddypress();
if (function_exists('bp_is_group') && !bp_is_group()) {
return;
}
//do not catch the request for creating new post
if (bp_is_action_variable('create', 0)) {
return;
}
$current_group = groups_get_current_group();
if (bcg_is_disabled($current_group->id)) {
return;
}
//if the group is private/hidden and user is not member, return
if (($current_group->status == 'private' || $current_group->status == 'hidden') && (!is_user_logged_in() || !groups_is_user_member(bp_loggedin_user_id(), $current_group->id))) {
return;
//avoid prioivacy troubles
}
if (bcg_is_component() && !empty($bp->action_variables[0])) {
//should we check for the existence of the post?
add_action('bp_template_content', array($this, 'get_single_post_contents'));
}
}
开发者ID:WP--plugins,项目名称:blog-categories-for-groups,代码行数:24,代码来源:bcg-screens.php
示例11: bp_has_forum_topic_posts
/**
* Initiate the loop for a single topic's posts.
*
* @param array $args {
* Arguments for limiting the contents of the topic posts loop.
* @type int $topic_id ID of the topic to which the posts belong.
* @type int $per_page Number of items to return per page. Default: 15.
* @type int $max Max items to return. Default: false.
* @type string $order 'ASC' or 'DESC'.
* }
* @return bool True when posts are found corresponding to the args,
* otherwise false.
*/
function bp_has_forum_topic_posts( $args = '' ) {
global $topic_template;
$defaults = array(
'topic_id' => false,
'per_page' => 15,
'max' => false,
'order' => 'ASC'
);
$r = bp_parse_args( $args, $defaults, 'has_forum_topic_posts' );
extract( $r, EXTR_SKIP );
if ( empty( $topic_id ) && bp_is_groups_component() && bp_is_current_action( 'forum' ) && bp_is_action_variable( 'topic', 0 ) && bp_action_variable( 1 ) )
$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 1 ) );
elseif ( empty( $topic_id ) && bp_is_forums_component() && bp_is_current_action( 'topic' ) && bp_action_variable( 0 ) )
$topic_id = bp_forums_get_topic_id_from_slug( bp_action_variable( 0 ) );
if ( empty( $topic_id ) ) {
return false;
} else {
$topic_template = new BP_Forums_Template_Topic( (int) $topic_id, $per_page, $max, $order );
// Current topic forum_id needs to match current_group forum_id
if ( bp_is_groups_component() && $topic_template->forum_id != groups_get_groupmeta( bp_get_current_group_id(), 'forum_id' ) )
return false;
}
/**
* Filters whether or not there are topics to display.
*
* @since BuddyPress (1.1.0)
*
* @param bool $value Whether or not there are topics.
* @param BP_Forums_Template_Topic $topic_template Topic template global to use when rendering.
*/
return apply_filters( 'bp_has_topic_posts', $topic_template->has_posts(), $topic_template );
}
开发者ID:pombredanne,项目名称:ArcherSys,代码行数:52,代码来源:bp-forums-template.php
示例12: bp_friends_header_tabs
/**
* Displays Friends header tabs
*
* @deprecated 1.6.0
* @deprecated No longer used
*/
function bp_friends_header_tabs()
{
_deprecated_function(__FUNCTION__, '1.6', 'Since BuddyPress 1.2, BP has not supported ordering of friend lists by URL parameters.');
?>
<li<?php
if (!bp_action_variable(0) || bp_is_action_variable('recently-active', 0)) {
?>
class="current"<?php
}
?>
><a href="<?php
echo trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/recently-active');
?>
"><?php
_e('Recently Active', 'buddypress');
?>
</a></li>
<li<?php
if (bp_is_action_variable('newest', 0)) {
?>
class="current"<?php
}
?>
><a href="<?php
echo trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/newest');
?>
"><?php
_e('Newest', 'buddypress');
?>
</a></li>
<li<?php
if (bp_is_action_variable('alphabetically', 0)) {
?>
class="current"<?php
}
?>
><a href="<?php
echo trailingslashit(bp_displayed_user_domain() . bp_get_friends_slug() . '/my-friends/alphabetically');
?>
"><?php
_e('Alphabetically', 'buddypress');
?>
</a></li>
<?php
do_action('friends_header_tabs');
}
开发者ID:mawilliamson,项目名称:wordpress,代码行数:54,代码来源:1.6.php
示例13: groups_screen_group_admin_manage_members
/**
* This function handles actions related to member management on the group admin.
*/
function groups_screen_group_admin_manage_members()
{
if ('manage-members' != bp_get_group_current_admin_tab()) {
return false;
}
if (!bp_is_item_admin()) {
return false;
}
$bp = buddypress();
if (bp_action_variable(1) && bp_action_variable(2) && bp_action_variable(3)) {
if (bp_is_action_variable('promote', 1) && (bp_is_action_variable('mod', 2) || bp_is_action_variable('admin', 2)) && is_numeric(bp_action_variable(3))) {
$user_id = bp_action_variable(3);
$status = bp_action_variable(2);
// Check the nonce first.
if (!check_admin_referer('groups_promote_member')) {
return false;
}
// Promote a user.
if (!groups_promote_member($user_id, $bp->groups->current_group->id, $status)) {
bp_core_add_message(__('There was an error when promoting that user. Please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('User promoted successfully', 'buddypress'));
}
/**
* Fires before the redirect after a group member has been promoted.
*
* @since 1.0.0
*
* @param int $user_id ID of the user being promoted.
* @param int $id ID of the group user is promoted within.
*/
do_action('groups_promoted_member', $user_id, $bp->groups->current_group->id);
bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/manage-members/');
}
}
if (bp_action_variable(1) && bp_action_variable(2)) {
if (bp_is_action_variable('demote', 1) && is_numeric(bp_action_variable(2))) {
$user_id = bp_action_variable(2);
// Check the nonce first.
if (!check_admin_referer('groups_demote_member')) {
return false;
}
// Stop sole admins from abandoning their group.
$group_admins = groups_get_group_admins($bp->groups->current_group->id);
if (1 == count($group_admins) && $group_admins[0]->user_id == $user_id) {
bp_core_add_message(__('This group must have at least one admin', 'buddypress'), 'error');
} elseif (!groups_demote_member($user_id, $bp->groups->current_group->id)) {
bp_core_add_message(__('There was an error when demoting that user. Please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('User demoted successfully', 'buddypress'));
}
/**
* Fires before the redirect after a group member has been demoted.
*
* @since 1.0.0
*
* @param int $user_id ID of the user being demoted.
* @param int $id ID of the group user is demoted within.
*/
do_action('groups_demoted_member', $user_id, $bp->groups->current_group->id);
bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/manage-members/');
}
if (bp_is_action_variable('ban', 1) && is_numeric(bp_action_variable(2))) {
$user_id = bp_action_variable(2);
// Check the nonce first.
if (!check_admin_referer('groups_ban_member')) {
return false;
}
// Ban a user.
if (!groups_ban_member($user_id, $bp->groups->current_group->id)) {
bp_core_add_message(__('There was an error when banning that user. Please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('User banned successfully', 'buddypress'));
}
/**
* Fires before the redirect after a group member has been banned.
*
* @since 1.0.0
*
* @param int $user_id ID of the user being banned.
* @param int $id ID of the group user is banned from.
*/
do_action('groups_banned_member', $user_id, $bp->groups->current_group->id);
bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/manage-members/');
}
if (bp_is_action_variable('unban', 1) && is_numeric(bp_action_variable(2))) {
$user_id = bp_action_variable(2);
// Check the nonce first.
if (!check_admin_referer('groups_unban_member')) {
return false;
}
// Remove a ban for user.
if (!groups_unban_member($user_id, $bp->groups->current_group->id)) {
bp_core_add_message(__('There was an error when unbanning that user. Please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('User ban removed successfully', 'buddypress'));
}
//.........这里部分代码省略.........
开发者ID:swissspidy,项目名称:BuddyPress,代码行数:101,代码来源:bp-groups-screens.php
示例14: bp_forums_add_forum_topic_to_page_title
/**
* bp_forums_add_forum_topic_to_page_title( $title )
*
* Append forum topic to page title
*
* @global object $bp
* @param string $title New page title; see bp_modify_page_title()
* @param string $title Original page title
* @param string $sep How to separate the various items within the page title.
* @param string $seplocation Direction to display title
* @return string
* @see bp_modify_page_title()
*/
function bp_forums_add_forum_topic_to_page_title($title, $original_title, $sep, $seplocation)
{
global $bp;
if (bp_is_current_action('forum') && bp_is_action_variable('topic', 0)) {
if (bp_has_forum_topic_posts()) {
$title .= bp_get_the_topic_title() . " {$sep} ";
}
}
return $title;
}
开发者ID:hornetalcala,项目名称:trunk,代码行数:23,代码来源:bp-forums-filters.php
示例15: bp_follow_my_following_feed
/**
* Add RSS feed support for a user's following activity.
*
* eg. example.com/members/USERNAME/activity/following/feed/
*
* Only available in BuddyPress 1.8+.
*
* @since 1.2.1
* @author r-a-y
*/
function bp_follow_my_following_feed()
{
// only available in BP 1.8+
if (!class_exists('BP_Activity_Feed')) {
return;
}
if (!bp_is_user_activity() || !bp_is_current_action(constant('BP_FOLLOWING_SLUG')) || !bp_is_action_variable('feed', 0)) {
return false;
}
global $bp;
// setup the feed
$bp->activity->feed = new BP_Activity_Feed(array('id' => 'myfollowing', 'title' => sprintf(__('%1$s | %2$s | Following Activity', 'bp-follow'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => trailingslashit(bp_displayed_user_domain() . bp_get_activity_slug() . '/' . constant('BP_FOLLOWING_SLUG')), 'description' => sprintf(__("Activity feed for people that %s is following.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => array('user_id' => bp_get_following_ids(), 'display_comments' => 'threaded')));
}
开发者ID:wesavetheworld,项目名称:buddypress-followers,代码行数:23,代码来源:actions.php
示例16: groups_screen_group_admin_delete_group
function groups_screen_group_admin_delete_group()
{
global $bp;
if (bp_is_groups_component() && bp_is_action_variable('delete-group', 0)) {
if (!$bp->is_item_admin && !bp_current_user_can('bp_moderate')) {
return false;
}
if (isset($_REQUEST['delete-group-button']) && isset($_REQUEST['delete-group-understand'])) {
// Check the nonce first.
if (!check_admin_referer('groups_delete_group')) {
return false;
}
do_action('groups_before_group_deleted', $bp->groups->current_group->id);
// Group admin has deleted the group, now do it.
if (!groups_delete_group($bp->groups->current_group->id)) {
bp_core_add_message(__('There was an error deleting the group, please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('The group was deleted successfully', 'buddypress'));
do_action('groups_group_deleted', $bp->groups->current_group->id);
bp_core_redirect(bp_loggedin_user_domain() . bp_get_groups_slug() . '/');
}
bp_core_redirect(bp_loggedin_user_domain() . bp_get_groups_slug());
}
do_action('groups_screen_group_admin_delete_group', $bp->groups->current_group->id);
bp_core_load_template(apply_filters('groups_template_group_admin_delete_group', 'groups/single/home'));
}
}
开发者ID:newington,项目名称:buddypress,代码行数:27,代码来源:bp-groups-screens.php
示例17: invite_anyone_catch_send
/**
* Catch and process email sends.
*
* @since 1.1.0
*/
function invite_anyone_catch_send()
{
global $bp;
if (!bp_is_current_component($bp->invite_anyone->slug)) {
return;
}
if (!bp_is_current_action('sent-invites')) {
return;
}
if (!bp_is_action_variable('send', 0)) {
return;
}
if (!invite_anyone_process_invitations(stripslashes_deep($_POST))) {
bp_core_add_message(__('Sorry, there was a problem sending your invitations. Please try again.', 'invite-anyone'), 'error');
}
bp_core_redirect(bp_displayed_user_domain() . $bp->invite_anyone->slug . '/sent-invites');
}
开发者ID:kd5ytx,项目名称:Empirical-Wordpress,代码行数:22,代码来源:by-email.php
示例18: bp_is_course_creation_step
function bp_is_course_creation_step($step_slug)
{
global $bp;
/* Make sure we are in the courses component */
if (!bp_is_courses_component() || !bp_is_current_action('create')) {
return false;
}
/* If this the first step, we can just accept and return true */
$keys = array_keys($bp->courses->course_creation_steps);
if (!bp_action_variable(1) && array_shift($keys) == $step_slug) {
return true;
}
/* Before allowing a user to see a course creation step we must make sure previous steps are completed */
if (!bp_is_first_course_creation_step()) {
if (!bp_are_previous_course_creation_steps_complete($step_slug)) {
return false;
}
}
/* Check the current step against the step parameter */
if (bp_is_action_variable($step_slug)) {
return true;
}
return false;
}
开发者ID:akshayxhtmljunkies,项目名称:brownglock,代码行数:24,代码来源:bp-course-template.php
示例19: rss_handler
/**
* RSS handler for a user's followed sites.
*
* When a user lands on /members/USERNAME/activity/followblogs/feed/, this
* method generates the RSS feed for their followed sites.
*/
public static function rss_handler()
{
// only available in BP 1.8+
if (!class_exists('BP_Activity_Feed')) {
return;
}
if (!bp_is_user_activity() || !bp_is_current_action(constant('BP_FOLLOW_BLOGS_USER_ACTIVITY_SLUG')) || !bp_is_action_variable('feed', 0)) {
return;
}
// get blog IDs that the user is following
$following_ids = bp_get_following_ids(array('follow_type' => 'blogs'));
// if $following_ids is empty, pass a negative number so no blogs can be found
$following_ids = empty($following_ids) ? -1 : $following_ids;
$args = array('user_id' => 0, 'object' => 'blogs', 'primary_id' => $following_ids);
// setup the feed
buddypress()->activity->feed = new BP_Activity_Feed(array('id' => 'followedsites', 'title' => sprintf(__('%1$s | %2$s | Followed Site Activity', 'bp-follow'), bp_get_site_name(), bp_get_displayed_user_fullname()), 'link' => trailingslashit(bp_displayed_user_domain() . bp_get_activity_slug() . '/' . constant('BP_FOLLOW_BLOGS_USER_ACTIVITY_SLUG')), 'description' => sprintf(__("Activity feed for sites that %s is following.", 'buddypress'), bp_get_displayed_user_fullname()), 'activity_args' => $args));
}
开发者ID:vikramshaw,项目名称:buddypress-followers,代码行数:23,代码来源:blogs.php
示例20: setup_edit_hooks
/**
* Hook this extension's Edit panel into BuddyPress, if necessary.
*
* @since BuddyPress (1.8.0)
*/
protected function setup_edit_hooks()
{
// Bail if not in a group
if (!bp_is_group()) {
return;
}
// Bail if not an edit screen
if (!$this->is_screen_enabled('edit') || !bp_is_item_admin()) {
return;
}
$screen = $this->screens['edit'];
$position = isset($screen['position']) ? (int) $screen['position'] : 10;
$position += 40;
$current_group = groups_get_current_group();
$admin_link = trailingslashit(bp_get_group_permalink($current_group) . 'admin');
$subnav_args = array('name' => $screen['name'], 'slug' => $screen['slug'], 'parent_slug' => $current_group->slug . '_manage', 'parent_url' => trailingslashit(bp_get_group_permalink($current_group) . 'admin'), 'user_has_access' => bp_is_item_admin(), 'position' => $position, 'screen_function' => 'groups_screen_group_admin');
// Should we add a menu to the Group's WP Admin Bar
if (!empty($screen['show_in_admin_bar'])) {
$subnav_args['show_in_admin_bar'] = true;
}
// Add the tab to the manage navigation
bp_core_new_subnav_item($subnav_args);
// Catch the edit screen and forward it to the plugin template
if (bp_is_groups_component() && bp_is_current_action('admin') && bp_is_action_variable($screen['slug'], 0)) {
$this->call_edit_screen_save($this->group_id);
add_action('groups_custom_edit_steps', array(&$this, 'call_edit_screen'));
// Determine the proper template and save for later
// loading
if ('' !== bp_locate_template(array('groups/single/home.php'), false)) {
$this->edit_screen_template = '/groups/single/home';
} else {
add_action('bp_template_content_header', create_function('', 'echo "<ul class=\\"content-header-nav\\">"; bp_group_admin_tabs(); echo "</ul>";'));
add_action('bp_template_content', array(&$this, 'call_edit_screen'));
$this->edit_screen_template = '/groups/single/plugins';
}
// We load the template at bp_screens, to give all
// extensions a chance to load
add_action('bp_screens', array($this, 'call_edit_screen_template_loader'));
}
}
开发者ID:AceMedia,项目名称:BuddyPress,代码行数:45,代码来源:class-bp-group-extension.php
注:本文中的bp_is_action_variable函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论