Changeset 51524
- Timestamp:
- 08/01/2021 02:54:52 PM (23 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/theme.php
r51251 r51524 967 967 * 968 968 * @since 3.1.0 969 * 970 * @return array|void Theme modifications. 969 * @since 5.9.0 The return value is always an array. 970 * 971 * @return array Theme modifications. 971 972 */ 972 973 function get_theme_mods() { 973 974 $theme_slug = get_option( 'stylesheet' ); 974 975 $mods = get_option( "theme_mods_$theme_slug" ); 976 975 977 if ( false === $mods ) { 976 978 $theme_name = get_option( 'current_theme' ); … … 978 980 $theme_name = wp_get_theme()->get( 'Name' ); 979 981 } 982 980 983 $mods = get_option( "mods_$theme_name" ); // Deprecated location. 981 984 if ( is_admin() && false !== $mods ) { … … 984 987 } 985 988 } 989 990 if ( ! is_array( $mods ) ) { 991 $mods = array(); 992 } 993 986 994 return $mods; 987 995 } -
trunk/tests/phpunit/tests/option/themeMods.php
r48937 r51524 18 18 set_theme_mod( 'test_name', $expected ); 19 19 $this->assertSame( $expected, get_theme_mod( 'test_name' ) ); 20 } 21 22 /** 23 * @ticket 51423 24 */ 25 function test_theme_mod_set_with_invalid_theme_mods_option() { 26 $theme_slug = get_option( 'stylesheet' ); 27 update_option( 'theme_mods_' . $theme_slug, '' ); 28 self::test_theme_mod_set(); 20 29 } 21 30
Note: See TracChangeset
for help on using the changeset viewer.