tgmpa

Helper function to register a collection of required plugins.

Description

tgmpa( (array) $plugins, (array) $config = array() ); 

Parameters (2)

0. $plugins (array)
An array of plugin arrays.
1. $config — Optional. (array) => array()
An array of configuration values.

Usage

  1. if ( !function_exists( 'tgmpa' ) ) { 
  2. require_once '/includes/class-tgm-plugin-activation.php'; 
  3.  
  4. // An array of plugin arrays. 
  5. $plugins = array(); 
  6.  
  7. // Optional. An array of configuration values. 
  8. $config = array(); 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = tgmpa($plugins, $config); 
  12.  

Defined (1)

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

/includes/class-tgm-plugin-activation.php  
  1. function tgmpa( $plugins, $config = array() ) { 
  2. $instance = call_user_func( array( get_class( $GLOBALS['onetone'] ), 'get_instance' ) ); 
  3.  
  4. foreach ( $plugins as $plugin ) { 
  5. call_user_func( array( $instance, 'register' ), $plugin ); 
  6.  
  7. if ( ! empty( $config ) && is_array( $config ) ) { 
  8. call_user_func( array( $instance, 'config' ), $config );