tgmpa_load

By default TGMPA only loads on the WP back-end and not in an Ajax call.

Description

apply_filters( 'tgmpa_load', (bool) $is_admin_defined_doing_ajax ); 

Using this filter you can overrule that behaviour.

Parameters (1)

0. $is_admin_defined_doing_ajax (bool) => ( is_admin() && ! defined( 'DOING_AJAX' ) )
Whether or not TGMPA should load. Defaults to the return of is_admin() && ! defined( DOING_AJAX' )'.

Usage

To run the hook, copy the example below.
  1. $is_admin_defined_doing_ajax = apply_filters( 'tgmpa_load', $is_admin_defined_doing_ajax ); 
  2.  
  3. if ( !empty( $is_admin_defined_doing_ajax ) ) { 
  4.  
  5. // everything has led up to this point... 
  6.  
  7.  
The following example is for adding a hook callback.
  1. // define the tgmpa_load callback 
  2. function filter_tgmpa_load( $is_admin_defined_doing_ajax ) { 
  3. // make filter magic happen here... 
  4. return $is_admin_defined_doing_ajax
  5. }; 
  6.  
  7. // add the filter 
  8. add_filter( 'tgmpa_load', 'filter_tgmpa_load', 10, 1 ); 
To remove a hook callback, use the example below.
  1. // remove the filter 
  2. remove_filter( 'tgmpa_load', 'filter_tgmpa_load', 10, 1 ); 

Defined (1)

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

/class-tgm-plugin-activation.php  
  1. if ( true !== apply_filters( 'tgmpa_load', ( is_admin() && ! defined( 'DOING_AJAX' ) ) ) ) {