diff options
author | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-04 13:20:38 +0000 |
---|---|---|
committer | donncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36> | 2007-01-04 13:20:38 +0000 |
commit | 861bd9122e6d9ee710df2b6fc0a1222a8a8965cf (patch) | |
tree | da5020f0e73f0f0ee5f8466250ce041fe22a53d0 /wp-includes/theme.php | |
parent | d71327104baa1c83106f008a3ed11aee70edc50d (diff) | |
download | wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.tar.gz wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.tar.xz wordpress-mu-861bd9122e6d9ee710df2b6fc0a1222a8a8965cf.zip |
WP Merge to 4674
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@830 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-includes/theme.php')
-rw-r--r-- | wp-includes/theme.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/wp-includes/theme.php b/wp-includes/theme.php index ca1ae60..f527b42 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -455,10 +455,54 @@ function set_theme_mod($name, $value) { wp_cache_delete("mods_$theme", 'options'); } +function remove_theme_mod( $name ) { + $theme = get_current_theme(); + + $mods = get_option("mods_$theme"); + + if ( !isset($mods[$name]) ) + return; + + unset($mods[$name]); + + if ( empty($mods) ) + return remove_theme_mods(); + + update_option("mods_$theme", $mods); + wp_cache_delete("mods_$theme", 'options'); +} + function remove_theme_mods() { $theme = get_current_theme(); delete_option("mods_$theme"); } +function get_header_textcolor() { + return get_theme_mod('header_textcolor', HEADER_TEXTCOLOR); +} + +function header_textcolor() { + echo get_header_textcolor(); +} + +function get_header_image() { + return get_theme_mod('header_image', HEADER_IMAGE); +} + +function header_image() { + echo get_header_image(); +} + +function add_custom_image_header($header_callback, $admin_header_callback) { + if ( ! empty($header_callback) ) + add_action('wp_head', $header_callback); + + if ( ! is_admin() ) + return; + require_once(ABSPATH . 'wp-admin/custom-header.php'); + $GLOBALS['custom_image_header'] =& new Custom_Image_Header($admin_header_callback); + add_action('admin_menu', array(&$GLOBALS['custom_image_header'], 'init')); +} + ?> |