get_theme_mods() WP 1.0
Retrieve all theme modifications.
Works based on: get_option()
1 time = 0.001737s = very slow | 50000 times = 2.25s = fast | PHP 7.0.32, WP 5.0.3
No Hooks.
Return
Array/null. Theme modifications.
Usage
get_theme_mods();
Changelog
Since 3.1.0 | Introduced. |
Code of get_theme_mods() get theme mods WP 5.6
function get_theme_mods() {
$theme_slug = get_option( 'stylesheet' );
$mods = get_option( "theme_mods_$theme_slug" );
if ( false === $mods ) {
$theme_name = get_option( 'current_theme' );
if ( false === $theme_name ) {
$theme_name = wp_get_theme()->get( 'Name' );
}
$mods = get_option( "mods_$theme_name" ); // Deprecated location.
if ( is_admin() && false !== $mods ) {
update_option( "theme_mods_$theme_slug", $mods );
delete_option( "mods_$theme_name" );
}
}
return $mods;
}Related Functions
From tag: Theme Modification API (theme mods options settings)
More from category: Other Theme Functions
- add_theme_support()
- bloginfo()
- body_class()
- current_theme_supports()
- get_custom_header_markup()
- get_custom_logo()
- get_header_image()
- get_header_image_tag()
- get_header_textcolor()
- get_header_video_url()
- get_page_templates()
- get_post_class()
- get_query_template()
- get_stylesheet()
- get_template()
- get_theme_root()
- has_custom_logo()
- has_header_image()
- has_header_video()
- is_child_theme()
- is_header_video_active()
- is_multi_author()
- post_class()
- register_nav_menu()
- register_nav_menus()
- register_theme_directory()
- remove_theme_support()
- search_theme_directories()
- single_month_title()
- the_custom_header_markup()
- the_custom_logo()
- the_header_video_url()