bp_core_ajax_url

Get the proper value for BP's ajaxurl.

Description

(string) bp_core_ajax_url(); 

Designed to be sensitive to FORCE_SSL_ADMIN and non-standard multisite configurations.

Returns (string)

AJAX endpoint URL.


Usage

  1. if ( !function_exists( 'bp_core_ajax_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'buddypress/bp-core/bp-core-cssjs.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = bp_core_ajax_url(); 
  7.  

Defined (1)

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

/bp-core/bp-core-cssjs.php  
  1. function bp_core_ajax_url() { 
  2.  
  3. /** 
  4. * Filters the proper value for BuddyPress' ajaxurl. 
  5. * @since 1.7.0 
  6. * @param string $value Proper ajaxurl value for BuddyPress. 
  7. */ 
  8. return apply_filters( 'bp_core_ajax_url', admin_url( 'admin-ajax.php', is_ssl() ? 'admin' : 'http' ) );