aioseop_update_settings_check

Check if settings need to be updated / migrated from old version.

Description

aioseop_update_settings_check(); 

Usage

  1. if ( !function_exists( 'aioseop_update_settings_check' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'all-in-one-seo-pack/inc/aioseop_functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = aioseop_update_settings_check(); 
  7.  

Defined (1)

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

/inc/aioseop_functions.php  
  1. function aioseop_update_settings_check() { 
  2. global $aioseop_options; 
  3. if ( empty( $aioseop_options ) || isset( $_POST['aioseop_migrate_options'] ) ) { 
  4. // WPML has now attached to filters, read settings again so they can be translated. 
  5. $update_options = false; 
  6. if ( ! empty( $aioseop_options ) ) { 
  7. if ( ! empty( $aioseop_options['aiosp_archive_noindex'] ) ) { // Migrate setting for noindex archives. 
  8. $aioseop_options['aiosp_archive_date_noindex'] = $aioseop_options['aiosp_archive_author_noindex'] = $aioseop_options['aiosp_archive_noindex']; 
  9. unset( $aioseop_options['aiosp_archive_noindex'] ); 
  10. $update_options = true; 
  11. if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && empty( $aioseop_options['aiosp_date_title_format'] ) ) { 
  12. $aioseop_options['aiosp_date_title_format'] = $aioseop_options['aiosp_archive_title_format']; 
  13. unset( $aioseop_options['aiosp_archive_title_format'] ); 
  14. $update_options = true; 
  15. if ( ! empty( $aioseop_options['aiosp_archive_title_format'] ) && ( $aioseop_options['aiosp_archive_title_format'] === '%date% | %blog_title%' ) ) { 
  16. $aioseop_options['aiosp_archive_title_format'] = '%archive_title% | %blog_title%'; 
  17. $update_options = true; 
  18. if ( $update_options ) { 
  19. update_option( 'aioseop_options', $aioseop_options );