wpseo_auto_load

Auto load our class files.

Description

wpseo_auto_load( (string) $class ); 

Parameters (1)

0. $class (string)
Class name.

Usage

  1. if ( !function_exists( 'wpseo_auto_load' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/wp-seo-main.php'; 
  3.  
  4. // Class name. 
  5. $class = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = wpseo_auto_load($class); 
  9.  

Defined (1)

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

/wp-seo-main.php  
  1. function wpseo_auto_load( $class ) { 
  2. static $classes = null; 
  3.  
  4. if ( $classes === null ) { 
  5. $classes = array( 
  6. wp_list_table => ABSPATH . 'wp-admin/includes/class-wp-list-table.php',  
  7. walker_category => ABSPATH . 'wp-includes/category-template.php',  
  8. pclzip => ABSPATH . 'wp-admin/includes/class-pclzip.php',  
  9. ); 
  10.  
  11. $cn = strtolower( $class ); 
  12.  
  13. if ( ! class_exists( $class ) && isset( $classes[ $cn ] ) ) { 
  14. require_once( $classes[ $cn ] );