Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/21/2012 05:26:22 PM (13 years ago)
Author:
djpaul
Message:

Resolve problems with load order when handling AJAX requests in BuddyPress. Fixes #2599 and #3985, props DJPaul and boonebgorges.

  • Reworks BP-Default's AJAX calls to use correct receiver in WordPress.
  • Hooks BP-Default's AJAX handlers to both 'wp_ajax_nopriv_' and 'wp_ajax'.
  • Updates associated parts in BP core to support this, and deprecates old handling.
  • Renames Activity spam/unspam AJAX actions (new to BP 1.6).
  • Adds full PHPDoc to ajax.php.
  • Code standards pass of ajax.php.
  • Remove unnecessary globals.
  • Backwards compatible with themes based on versions of BP-Default earlier 1.6.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-functions.php

    r5993 r6003  
    699699}
    700700add_action ( 'bp_init', 'bp_core_load_buddypress_textdomain', 2 );
    701 
    702 function bp_core_add_ajax_hook() {
    703     // Theme only, we already have the wp_ajax_ hook firing in wp-admin
    704     if ( !defined( 'WP_ADMIN' ) && isset( $_REQUEST['action'] ) )
    705         do_action( 'wp_ajax_' . $_REQUEST['action'] );
    706 }
    707 add_action( 'bp_init', 'bp_core_add_ajax_hook', 20 );
    708701
    709702/**
Note: See TracChangeset for help on using the changeset viewer.