bbp_do_ajax

Hooked to the 'bbp_template_redirect' action, this is bbPress's custom theme-side ajax handler.

Description

bbp_do_ajax(); 

Usage

  1. if ( !function_exists( 'bbp_do_ajax' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'bbpress/includes/common/ajax.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bbp_do_ajax(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/common/ajax.php  
  1. function bbp_do_ajax() { 
  2.  
  3. // Bail if not an ajax request 
  4. if ( ! bbp_is_ajax() ) 
  5. return; 
  6.  
  7. // Set WordPress core ajax constant 
  8. define( 'DOING_AJAX', true ); 
  9.  
  10. // Set the header content type 
  11. @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) ); 
  12.  
  13. // Disable content sniffing in browsers that support it 
  14. send_nosniff_header(); 
  15.  
  16. // Perform custom bbPress ajax 
  17.  
  18. // All done 
  19. die( '0' );