本文整理汇总了PHP中bp_core_delete_notifications_by_type函数的典型用法代码示例。如果您正苦于以下问题:PHP bp_core_delete_notifications_by_type函数的具体用法?PHP bp_core_delete_notifications_by_type怎么用?PHP bp_core_delete_notifications_by_type使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bp_core_delete_notifications_by_type函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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_clear_friend_notifications
function friends_clear_friend_notifications()
{
global $bp;
if (isset($_GET['new'])) {
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), $bp->friends->id, 'friendship_accepted');
}
}
开发者ID:newington,项目名称:buddypress,代码行数:7,代码来源:bp-friends-cache.php
示例3: bp_em_remove_screen_notifications
/**
* Remove a screen notification for a user.
*/
function bp_em_remove_screen_notifications()
{
global $bp;
if (function_exists('bp_notifications_delete_notifications_by_type')) {
//backwards compat for BP 1.9
bp_notifications_delete_notifications_by_type($bp->loggedin_user->id, $bp->events->slug, 'attending');
} else {
bp_core_delete_notifications_by_type($bp->loggedin_user->id, $bp->events->slug, 'attending');
}
}
开发者ID:sajjadalisiddiqui,项目名称:cms,代码行数:13,代码来源:bp-em-notifications.php
示例4: bp_em_my_bookings
/**
* bp_em_screen_two()
*
* Sets up and displays the screen output for the sub nav item "em/screen-two"
*/
function bp_em_my_bookings()
{
global $bp, $EM_Event;
//assume any notifications here are considered viewed via this page
bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'pending_booking');
bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'confirmed_booking');
bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'cancelled_booking');
em_load_event();
/**
* If the user has not Accepted or Rejected anything, then the code above will not run,
* we can continue and load the template.
*/
do_action('bp_em_my_bookings');
add_action('bp_template_title', 'bp_em_my_bookings_title');
add_action('bp_template_content', 'bp_em_my_bookings_content');
/* Finally load the plugin template file. */
bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
}
开发者ID:batruji,项目名称:metareading,代码行数:23,代码来源:my-bookings.php
示例5: groups_screen_group_admin_requests
function groups_screen_group_admin_requests()
{
global $bp;
if (bp_is_groups_component() && bp_is_action_variable('membership-requests', 0)) {
if (!$bp->is_item_admin || 'public' == $bp->groups->current_group->status) {
return false;
}
// Remove any screen notifications
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), $bp->groups->id, 'new_membership_request');
$request_action = (string) bp_action_variable(1);
$membership_id = (int) bp_action_variable(2);
if (!empty($request_action) && !empty($membership_id)) {
if ('accept' == $request_action && is_numeric($membership_id)) {
// Check the nonce first.
if (!check_admin_referer('groups_accept_membership_request')) {
return false;
}
// Accept the membership request
if (!groups_accept_membership_request($membership_id)) {
bp_core_add_message(__('There was an error accepting the membership request, please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('Group membership request accepted', 'buddypress'));
}
} elseif ('reject' == $request_action && is_numeric($membership_id)) {
/* Check the nonce first. */
if (!check_admin_referer('groups_reject_membership_request')) {
return false;
}
// Reject the membership request
if (!groups_reject_membership_request($membership_id)) {
bp_core_add_message(__('There was an error rejecting the membership request, please try again.', 'buddypress'), 'error');
} else {
bp_core_add_message(__('Group membership request rejected', 'buddypress'));
}
}
do_action('groups_group_request_managed', $bp->groups->current_group->id, $request_action, $membership_id);
bp_core_redirect(bp_get_group_permalink(groups_get_current_group()) . 'admin/membership-requests/');
}
do_action('groups_screen_group_admin_requests', $bp->groups->current_group->id);
bp_core_load_template(apply_filters('groups_template_group_admin_requests', 'groups/single/home'));
}
}
开发者ID:newington,项目名称:buddypress,代码行数:42,代码来源:bp-groups-screens.php
示例6: bp_has_message_threads
function bp_has_message_threads($args = '')
{
global $bp, $messages_template;
$defaults = array('user_id' => bp_loggedin_user_id(), 'box' => 'inbox', 'per_page' => 10, 'max' => false, 'type' => 'all', 'search_terms' => isset($_REQUEST['s']) ? stripslashes($_REQUEST['s']) : '', 'page_arg' => 'mpage');
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
if (bp_is_current_action('notices') && !bp_current_user_can('bp_moderate')) {
wp_redirect(bp_displayed_user_id());
} else {
if (bp_is_current_action('inbox')) {
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), $bp->messages->id, 'new_message');
}
if (bp_is_current_action('sentbox')) {
$box = 'sentbox';
}
if (bp_is_current_action('notices')) {
$box = 'notices';
}
$messages_template = new BP_Messages_Box_Template($user_id, $box, $per_page, $max, $type, $search_terms, $page_arg);
}
return apply_filters('bp_has_message_threads', $messages_template->has_threads(), $messages_template);
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:22,代码来源:bp-messages-template.php
示例7: bp_activity_remove_screen_notifications
/**
* Removes activity notifications from the notification menu when a user clicks on them and
* is taken to a specific screen.
*
* @since BuddyPress (1.5)
*
* @global object $bp BuddyPress global settings
* @uses bp_core_delete_notifications_by_type()
*/
function bp_activity_remove_screen_notifications()
{
global $bp;
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), $bp->activity->id, 'new_at_mention');
}
开发者ID:pyropictures,项目名称:wordpress-plugins,代码行数:14,代码来源:bp-activity-screens.php
示例8: bp_has_message_threads
function bp_has_message_threads($args = '')
{
global $bp, $messages_template;
$defaults = array('user_id' => $bp->loggedin_user->id, 'box' => 'inbox', 'per_page' => 10, 'max' => false, 'type' => 'all');
$r = nxt_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
if ('notices' == $bp->current_action && !is_super_admin()) {
nxt_redirect($bp->displayed_user->id);
} else {
if ('inbox' == $bp->current_action) {
bp_core_delete_notifications_by_type($bp->loggedin_user->id, $bp->messages->id, 'new_message');
}
if ('sentbox' == $bp->current_action) {
$box = 'sentbox';
}
if ('notices' == $bp->current_action) {
$box = 'notices';
}
$messages_template = new BP_Messages_Box_Template($user_id, $box, $per_page, $max, $type);
}
return apply_filters('bp_has_message_threads', $messages_template->has_threads(), $messages_template);
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:22,代码来源:bp-messages-template.php
示例9: bp_follow_notifications_delete_on_followers_page
/**
* Delete notifications when a logged-in user visits their followers page.
*
* Since 1.2.1, when the "X users are now following you" notification appears,
* users will be redirected to the new notifications unread page instead of
* the logged-in user's followers page. This is so users can see who followed
* them and in the date order in which they were followed.
*
* For backwards-compatibility, we still keep the old method of redirecting to
* the logged-in user's followers page so notifications can be deleted for
* older versions of BuddyPress.
*
* Will probably remove this in a future release.
*
* @since 1.2.1
*/
function bp_follow_notifications_delete_on_followers_page()
{
if (!isset($_GET['new'])) {
return;
}
if (!is_user_logged_in()) {
return;
}
// BP 1.9+
if (bp_is_active('notifications')) {
bp_notifications_delete_notifications_by_type(bp_loggedin_user_id(), $bp->follow->id, 'new_follow');
// BP < 1.9
} elseif (!class_exists('BP_Core_Login_Widget')) {
global $bp;
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), $bp->follow->id, 'new_follow');
}
}
开发者ID:vikramshaw,项目名称:buddypress-followers,代码行数:33,代码来源:notifications.php
示例10: dpa_setup_nav_directory
/**
* Sets up the Achievement Directory page
*
* @global object $bp BuddyPress global settings
* @global bool $is_member_page If we are under anything with a members slug
* @since 2.0
*/
function dpa_setup_nav_directory()
{
global $bp, $is_member_page;
if (bp_is_current_component($bp->achievements->slug) && !$bp->current_action && !$bp->current_item && !$is_member_page) {
$bp->is_directory = true;
if ($bp->loggedin_user->id) {
bp_core_delete_notifications_by_type($bp->loggedin_user->id, $bp->achievements->id, 'new_achievement');
}
do_action('dpa_setup_nav_directory');
bp_core_load_template(apply_filters('achievements_template_directory', 'achievements/index'));
return;
}
}
开发者ID:nxtclass,项目名称:NXTClass,代码行数:20,代码来源:achievements-core.php
示例11: bp_em_remove_screen_notifications
/**
* Remove a screen notification for a user.
*/
function bp_em_remove_screen_notifications()
{
global $bp;
bp_core_delete_notifications_by_type($bp->loggedin_user->id, $bp->events->slug, 'attending');
}
开发者ID:adisonc,项目名称:MaineLearning,代码行数:8,代码来源:bp-em-notifications.php
示例12: bp_checkins_my_places
function bp_checkins_my_places()
{
if (isset($_GET['n'])) {
bp_core_delete_notifications_by_type(bp_loggedin_user_id(), 'checkins', 'new_comment');
}
bp_core_load_template(apply_filters('bp_checkins_my_places', 'bp-checkins-my-places'));
if (!bp_checkins_is_bp_default()) {
add_filter('bp_get_template_part', 'bp_checkins_user_places_template_part', 10, 3);
}
}
开发者ID:socialray,项目名称:surfied-2-0,代码行数:10,代码来源:bp-checkins-screens.php
注:本文中的bp_core_delete_notifications_by_type函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论