gmb_get_ajax_url

Get AJAX URL.

Description

(string) gmb_get_ajax_url(); 

Returns (string)


Usage

  1. if ( !function_exists( 'gmb_get_ajax_url' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'maps-builder/vendor/wordimpress/maps-builder-core/includes/misc-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = gmb_get_ajax_url(); 
  7.  

Defined (1)

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

/vendor/wordimpress/maps-builder-core/includes/misc-functions.php  
  1. function gmb_get_ajax_url() { 
  2. $scheme = defined( 'FORCE_SSL_ADMIN' ) && FORCE_SSL_ADMIN ? 'https' : 'admin'; 
  3.  
  4. $current_url = gmb_get_current_page_url(); 
  5. $ajax_url = admin_url( 'admin-ajax.php', $scheme ); 
  6.  
  7. if ( preg_match( '/^https/', $current_url ) && ! preg_match( '/^https/', $ajax_url ) ) { 
  8. $ajax_url = preg_replace( '/^http/', 'https', $ajax_url ); 
  9.  
  10. return apply_filters( 'gmb_ajax_url', $ajax_url );