wpseo_init

On plugins_loaded: load the minimum amount of essential files for this plugin.

Description

wpseo_init(); 

Usage

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

Defined (1)

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

/wp-seo-main.php  
  1. function wpseo_init() { 
  2. require_once( WPSEO_PATH . 'inc/wpseo-functions.php' ); 
  3. require_once( WPSEO_PATH . 'inc/wpseo-functions-deprecated.php' ); 
  4.  
  5. // Make sure our option and meta value validation routines and default values are always registered and available. 
  6. WPSEO_Options::get_instance(); 
  7. WPSEO_Meta::init(); 
  8.  
  9. $options = WPSEO_Options::get_options( array( 'wpseo', 'wpseo_permalinks', 'wpseo_xml' ) ); 
  10. if ( version_compare( $options['version'], WPSEO_VERSION, '<' ) ) { 
  11. new WPSEO_Upgrade(); 
  12. // Get a cleaned up version of the $options. 
  13. $options = WPSEO_Options::get_options( array( 'wpseo', 'wpseo_permalinks', 'wpseo_xml' ) ); 
  14.  
  15. if ( $options['stripcategorybase'] === true ) { 
  16. $GLOBALS[wpseo_rewrite] = new WPSEO_Rewrite; 
  17.  
  18. if ( $options['enablexmlsitemap'] === true ) { 
  19. $GLOBALS[wpseo_sitemaps] = new WPSEO_Sitemaps; 
  20.  
  21. if ( ! defined( 'DOING_AJAX' ) || ! DOING_AJAX ) { 
  22. require_once( WPSEO_PATH . 'inc/wpseo-non-ajax-functions.php' ); 
  23.  
  24. // Init it here because the filter must be present on the frontend as well or it won't work in the customizer.