gmb_die

Wrapper function for wp_die().

Description

gmb_die( (string) $message = '', (string) $title = '', (int) $status = 400 ); 

This function adds filters for wp_die() which kills execution of the script using wp_die(). This allows us to then to work with functions using gmb_die() in the unit tests.

Parameters (3)

0. $message — Optional. (string) => ''
The message.
1. $title — Optional. (string) => ''
The title.
2. $status — Optional. (int) => 400
The status.

Usage

  1. if ( !function_exists( 'gmb_die' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'maps-builder/vendor/wordimpress/maps-builder-core/includes/misc-functions.php'; 
  3.  
  4. // The message. 
  5. $message = ''; 
  6.  
  7. // The title. 
  8. $title = ''; 
  9.  
  10. // The status. 
  11. $status = 400; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = gmb_die($message, $title, $status); 
  15.  

Defined (1)

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

/vendor/wordimpress/maps-builder-core/includes/misc-functions.php  
  1. function gmb_die( $message = '', $title = '', $status = 400 ) { 
  2. add_filter( 'wp_die_ajax_handler', '_gmb_die_handler', 10, 3 ); 
  3. add_filter( 'wp_die_handler', '_gmb_die_handler', 10, 3 ); 
  4. wp_die( $message, $title, array( 'response' => $status ) );