Changeset 15739 for trunk/wp-includes/theme.php
- Timestamp:
- 10/07/2010 05:59:50 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r15736 r15739 1303 1303 * @since 3.1.0 1304 1304 * 1305 * @return mixed Theme modifications value.1305 * @return array Theme modifications. 1306 1306 */ 1307 1307 function get_theme_mods() { … … 1309 1309 if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 1310 1310 $theme_name = get_current_theme(); 1311 $mods = get_option( "mods_$theme_name" ); 1311 $mods = get_option( "mods_$theme_name" ); // Deprecated location. 1312 1312 if ( is_admin() && false !== $mods ) { 1313 1313 update_option( "theme_mods_$theme_slug", $mods ); … … 1333 1333 * @return string 1334 1334 */ 1335 function get_theme_mod( $name, $default = false) {1335 function get_theme_mod( $name, $default = false ) { 1336 1336 $mods = get_theme_mods(); 1337 1337 1338 if ( isset( $mods[$name]) )1339 return apply_filters( "theme_mod_$name", $mods[ $name] );1340 1341 return apply_filters( "theme_mod_$name", sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri()) );1338 if ( isset( $mods[ $name ] ) ) 1339 return apply_filters( "theme_mod_$name", $mods[ $name ] ); 1340 1341 return apply_filters( "theme_mod_$name", sprintf( $default, get_template_directory_uri(), get_stylesheet_directory_uri() ) ); 1342 1342 } 1343 1343 … … 1350 1350 * @param string $value theme modification value. 1351 1351 */ 1352 function set_theme_mod( $name, $value) {1352 function set_theme_mod( $name, $value ) { 1353 1353 $mods = get_theme_mods(); 1354 1354 1355 $mods[ $name] = $value;1355 $mods[ $name ] = $value; 1356 1356 1357 1357 $theme = get_option( 'stylesheet' ); … … 1374 1374 $mods = get_theme_mods(); 1375 1375 1376 if ( ! isset($mods[$name]) )1376 if ( ! isset( $mods[ $name ] ) ) 1377 1377 return; 1378 1378 1379 unset( $mods[$name]);1380 1381 if ( empty( $mods) )1379 unset( $mods[ $name ] ); 1380 1381 if ( empty( $mods ) ) 1382 1382 return remove_theme_mods(); 1383 1383
Note: See TracChangeset
for help on using the changeset viewer.