wpseo_on_activate_blog

Run wpseo activation routine on creation / activation of a multisite blog if WPSEO is activated network-wide.

Description

wpseo_on_activate_blog( (int) $blog_id ); 

Will only be called by multisite actions.

Parameters (1)

0. $blog_id (int)
The blog id.

Usage

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

Defined (1)

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

/wp-seo-main.php  
  1. function wpseo_on_activate_blog( $blog_id ) { 
  2. if ( ! function_exists( 'is_plugin_active_for_network' ) ) { 
  3. require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); 
  4.  
  5. if ( is_plugin_active_for_network( plugin_basename( WPSEO_FILE ) ) ) { 
  6. switch_to_blog( $blog_id ); 
  7. wpseo_activate( false ); 
  8. restore_current_blog();