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;
}
$setting->save();
}
+ do_action( 'customize_save_after', $this );
+
die;
}
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 ) {
* 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
*
* @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;
}
};