Skip to:
Content

BuddyPress.org

Changeset 6017


Ignore:
Timestamp:
05/07/2012 04:50:36 PM (12 years ago)
Author:
djpaul
Message:

Improve error messaging if AJAX activity favourite/unfavourite fails. See #4152

File:
1 edited

Legend:

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

    r6003 r6017  
    475475        return;
    476476
    477     bp_activity_add_user_favorite( $_POST['id'] );
    478     exit( __( 'Remove Favorite', 'buddypress' ) );
     477    if ( bp_activity_add_user_favorite( $_POST['id'] ) )
     478        _e( 'Remove Favorite', 'buddypress' );
     479    else
     480        _e( 'Favorite', 'buddypress' );
     481
     482    exit;
    479483}
    480484
     
    490494        return;
    491495
    492     bp_activity_remove_user_favorite( $_POST['id'] );
    493     exit( __( 'Favorite', 'buddypress' ) );
     496    if ( bp_activity_remove_user_favorite( $_POST['id'] ) )
     497        _e( 'Favorite', 'buddypress' );
     498    else
     499        _e( 'Remove Favorite', 'buddypress' );
     500
     501    exit;
    494502}
    495503
Note: See TracChangeset for help on using the changeset viewer.