]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/class-wp-customize-manager.php
Wordpress 3.6
[autoinstalls/wordpress.git] / wp-includes / class-wp-customize-manager.php
index 4be338969a03e386dd8c10f9495e741b4037384b..cad9f1351cd785412cd99996cd20582a773f3caf 100644 (file)
@@ -310,7 +310,7 @@ final class WP_Customize_Manager {
        public function post_value( $setting ) {
                if ( ! isset( $this->_post_values ) ) {
                        if ( isset( $_POST['customized'] ) )
-                               $this->_post_values = json_decode( stripslashes( $_POST['customized'] ), true );
+                               $this->_post_values = json_decode( wp_unslash( $_POST['customized'] ), true );
                        else
                                $this->_post_values = false;
                }
@@ -512,6 +512,8 @@ final class WP_Customize_Manager {
                        $setting->save();
                }
 
+               do_action( 'customize_save_after', $this );
+
                die;
        }
 
@@ -897,9 +899,7 @@ final class WP_Customize_Manager {
                if ( $menus ) {
                        $choices = array( 0 => __( '— Select —' ) );
                        foreach ( $menus as $menu ) {
-                               $truncated_name = wp_html_excerpt( $menu->name, 40 );
-                               $truncated_name = ( $truncated_name == $menu->name ) ? $menu->name : trim( $truncated_name ) . '…';
-                               $choices[ $menu->term_id ] = $truncated_name;
+                               $choices[ $menu->term_id ] = wp_html_excerpt( $menu->name, 40, '…' );
                        }
 
                        foreach ( $locations as $location => $description ) {
@@ -975,6 +975,7 @@ final class WP_Customize_Manager {
         * Callback for validating the header_textcolor value.
         *
         * Accepts 'blank', and otherwise uses sanitize_hex_color_no_hash().
+        * Returns default text color if hex color is empty.
         *
         * @since 3.4.0
         *
@@ -982,7 +983,14 @@ final class WP_Customize_Manager {
         * @return string
         */
        public function _sanitize_header_textcolor( $color ) {
-               return ( 'blank' === $color ) ? 'blank' : sanitize_hex_color_no_hash( $color );
+               if ( 'blank' === $color )
+                       return 'blank';
+
+               $color = sanitize_hex_color_no_hash( $color );
+               if ( empty( $color ) )
+                       $color = get_theme_support( 'custom-header', 'default-text-color' );
+
+               return $color;
        }
 };