bbp_do_ajax()

Hooked to the ‘bbp_template_redirect’ action, this is Forums’ custom theme-side ajax handler.

Description

Return

(If) not a Forums ajax request

Source

File: bp-forums/common/ajax.php

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
function bbp_do_ajax() {
 
    // Bail if not an ajax request
    if ( ! bbp_is_ajax() )
        return;
 
    // Set WordPress core ajax constant
    define( 'DOING_AJAX', true );
 
    // Set the header content type
    @header( 'Content-Type: text/html; charset=' . get_option( 'blog_charset' ) );
 
    // Disable content sniffing in browsers that support it
    send_nosniff_header();
 
    // Perform custom Forums ajax
    do_action( 'bbp_ajax_' . $_REQUEST['action'] );
 
    // All done
    die( '0' );
}

Changelog

Changelog
Version Description
bbPress (r4543) Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.