Changeset 8754 for trunk/src/bp-activity/bp-activity-actions.php
- Timestamp:
- 08/03/2014 08:52:05 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-actions.php
r8662 r8754 648 648 $bp->activity->akismet = new BP_Akismet(); 649 649 } 650 651 /** 652 * AJAX endpoint for Suggestions API lookups. 653 * 654 * @since BuddyPress (2.1.0) 655 */ 656 function bp_ajax_get_suggestions() { 657 if ( ! bp_is_user_active() || empty( $_GET['term'] ) || empty( $_GET['type'] ) ) { 658 wp_send_json_error( 'missing_parameter' ); 659 exit; 660 } 661 662 $results = bp_core_get_suggestions( array( 663 'term' => sanitize_text_field( $_GET['term'] ), 664 'type' => sanitize_text_field( $_GET['type'] ), 665 ) ); 666 667 if ( is_wp_error( $results ) ) { 668 wp_send_json_error( $results->get_error_message() ); 669 exit; 670 } 671 672 wp_send_json_success( $results ); 673 } 674 add_action( 'wp_ajax_bp_get_suggestions', 'bp_ajax_get_suggestions' );
Note: See TracChangeset
for help on using the changeset viewer.