monsterinsights_renamed_google_api_php_client_autoload

The Google Analytics for WordPress by MonsterInsights monsterinsights renamed google api php client autoload function.

Description

monsterinsights_renamed_google_api_php_client_autoload( (string) $className ); 

Parameters (1)

0. $classname (string)
The classname.

Usage

  1. if ( !function_exists( 'monsterinsights_renamed_google_api_php_client_autoload' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-analytics-for-wordpress-by-monsterinsights/assets/lib/google/src/Google/autoload.php'; 
  3.  
  4. // The classname. 
  5. $classname = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = monsterinsights_renamed_google_api_php_client_autoload($classname); 
  9.  

Defined (1)

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

/assets/lib/google/src/Google/autoload.php  
  1. function monsterinsights_renamed_google_api_php_client_autoload($className) 
  2. $classPath = explode('_', $className); 
  3. if ( empty( $classPath[0] ) || empty( $classPath[1] ) || empty( $classPath[2] ) ||  
  4. $classPath[0] != 'MonsterInsights' && $classPath[1] != 'GA' && $classPath[2] != 'Lib') { 
  5. return; 
  6. unset( $classPath[0] ); 
  7. unset( $classPath[1] ); 
  8. $classPath[2] = 'Google'; 
  9. // Drop 'MonsterInsights_GA_Lib', and maximum class file path depth in this project is 3. 
  10. $classPath = array_slice($classPath, 1, 2); 
  11. $filePath = dirname(__FILE__) . '/' . implode('/', $classPath) . '.php'; 
  12. if (file_exists($filePath)) { 
  13. require_once($filePath);