get_theme_mods

Retrieve all theme modifications.

Description

(array|void) get_theme_mods(); 

Returns (array|void)

Theme modifications.


Usage

  1. if ( !function_exists( 'get_theme_mods' ) ) { 
  2. require_once ABSPATH . WPINC . '/theme.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = get_theme_mods(); 
  7.  

Defined (1)

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

/wp-includes/theme.php  
  1. function get_theme_mods() { 
  2. $theme_slug = get_option( 'stylesheet' ); 
  3. $mods = get_option( "theme_mods_$theme_slug" ); 
  4. if ( false === $mods ) { 
  5. $theme_name = get_option( 'current_theme' ); 
  6. if ( false === $theme_name ) 
  7. $theme_name = wp_get_theme()->get('Name'); 
  8. $mods = get_option( "mods_$theme_name" ); // Deprecated location. 
  9. if ( is_admin() && false !== $mods ) { 
  10. update_option( "theme_mods_$theme_slug", $mods ); 
  11. delete_option( "mods_$theme_name" ); 
  12. return $mods;