Make WordPress Core


Ignore:
Timestamp:
10/07/2010 05:59:50 AM (14 years ago)
Author:
nacin
Message:

Some doc updates. see #15048.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/theme.php

    r15736 r15739  
    13031303 * @since 3.1.0
    13041304 *
    1305  * @return mixed Theme modifications value.
     1305 * @return array Theme modifications.
    13061306 */
    13071307function get_theme_mods() {
     
    13091309    if ( false === ( $mods = get_option( "theme_mods_$theme_slug" ) ) ) {
    13101310        $theme_name = get_current_theme();
    1311         $mods = get_option( "mods_$theme_name" );
     1311        $mods = get_option( "mods_$theme_name" ); // Deprecated location.
    13121312        if ( is_admin() && false !== $mods ) {
    13131313            update_option( "theme_mods_$theme_slug", $mods );
     
    13331333 * @return string
    13341334 */
    1335 function get_theme_mod($name, $default = false) {
     1335function get_theme_mod( $name, $default = false ) {
    13361336    $mods = get_theme_mods();
    13371337
    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() ) );
    13421342}
    13431343
     
    13501350 * @param string $value theme modification value.
    13511351 */
    1352 function set_theme_mod($name, $value) {
     1352function set_theme_mod( $name, $value ) {
    13531353    $mods = get_theme_mods();
    13541354
    1355     $mods[$name] = $value;
     1355    $mods[ $name ] = $value;
    13561356
    13571357    $theme = get_option( 'stylesheet' );
     
    13741374    $mods = get_theme_mods();
    13751375
    1376     if ( !isset($mods[$name]) )
     1376    if ( ! isset( $mods[ $name ] ) )
    13771377        return;
    13781378
    1379     unset($mods[$name]);
    1380 
    1381     if ( empty($mods) )
     1379    unset( $mods[ $name ] );
     1380
     1381    if ( empty( $mods ) )
    13821382        return remove_theme_mods();
    13831383
Note: See TracChangeset for help on using the changeset viewer.