Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/19/2010 09:26:59 PM (15 years ago)
Author:
apeatling
Message:

Better friendship request usability.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/ajax.php

    r2371 r2372  
    353353add_action( 'wp_ajax_addremove_friend', 'bp_dtheme_ajax_addremove_friend' );
    354354
     355function bp_dtheme_ajax_accept_friendship() {
     356    check_admin_referer( 'friends_accept_friendship' );
     357
     358    if ( !friends_accept_friendship( $_POST['id'] ) )
     359        echo "-1<div id='message' class='error'><p>" . __( 'There was a problem accepting that request. Please try again.', 'buddypress' ) . '</p></div>';
     360
     361    return true;
     362}
     363add_action( 'wp_ajax_accept_friendship', 'bp_dtheme_ajax_accept_friendship' );
     364
     365function bp_dtheme_ajax_reject_friendship() {
     366    check_admin_referer( 'friends_reject_friendship' );
     367
     368    if ( !friends_reject_friendship( $_POST['id'] ) )
     369        echo "-1<div id='message' class='error'><p>" . __( 'There was a problem rejecting that request. Please try again.', 'buddypress' ) . '</p></div>';
     370
     371    return true;
     372}
     373add_action( 'wp_ajax_reject_friendship', 'bp_dtheme_ajax_reject_friendship' );
     374
    355375function bp_dtheme_ajax_joinleave_group() {
    356376    global $bp;
Note: See TracChangeset for help on using the changeset viewer.