Changeset 15736
- Timestamp:
- 10/06/2010 09:00:17 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/theme.php
r15720 r15736 1299 1299 1300 1300 /** 1301 * Retrieve all theme modifications. 1302 * 1303 * @since 3.1.0 1304 * 1305 * @return mixed Theme modifications value. 1306 */ 1307 function get_theme_mods() { 1308 $theme_slug = get_option( 'stylesheet' ); 1309 if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) { 1310 $theme_name = get_current_theme(); 1311 $mods = get_option( "mods_$theme_name" ); 1312 if ( is_admin() && false !== $mods ) { 1313 update_option( "theme_mods_$theme_slug", $mods ); 1314 delete_option( "mods_$theme_name" ); 1315 } 1316 } 1317 return $mods; 1318 } 1319 1320 /** 1301 1321 * Retrieve theme modification value for the current theme. 1302 1322 * … … 1314 1334 */ 1315 1335 function get_theme_mod($name, $default = false) { 1316 $theme = get_current_theme(); 1317 1318 $mods = get_option( "mods_$theme" ); 1336 $mods = get_theme_mods(); 1319 1337 1320 1338 if ( isset($mods[$name]) ) … … 1333 1351 */ 1334 1352 function set_theme_mod($name, $value) { 1335 $theme = get_current_theme(); 1336 1337 $mods = get_option("mods_$theme"); 1353 $mods = get_theme_mods(); 1338 1354 1339 1355 $mods[$name] = $value; 1340 1356 1341 update_option("mods_$theme", $mods); 1342 wp_cache_delete("mods_$theme", 'options'); 1357 $theme = get_option( 'stylesheet' ); 1358 update_option( "theme_mods_$theme", $mods ); 1359 wp_cache_delete( "theme_mods_$theme", 'options' ); 1343 1360 } 1344 1361 … … 1355 1372 */ 1356 1373 function remove_theme_mod( $name ) { 1357 $theme = get_current_theme(); 1358 1359 $mods = get_option("mods_$theme"); 1374 $mods = get_theme_mods(); 1360 1375 1361 1376 if ( !isset($mods[$name]) ) … … 1367 1382 return remove_theme_mods(); 1368 1383 1369 update_option("mods_$theme", $mods); 1370 wp_cache_delete("mods_$theme", 'options'); 1384 $theme = get_option( 'stylesheet' ); 1385 update_option( "theme_mods_$theme", $mods ); 1386 wp_cache_delete( "theme_mods_$theme", 'options' ); 1371 1387 } 1372 1388 … … 1377 1393 */ 1378 1394 function remove_theme_mods() { 1379 $theme = get_current_theme(); 1380 1381 delete_option("mods_$theme"); 1395 delete_option( 'theme_mods_' . get_option( 'stylesheet' ) ); 1396 delete_option( 'mods_' . get_current_theme() ); 1382 1397 } 1383 1398
Note: See TracChangeset
for help on using the changeset viewer.