Make WordPress Core

Opened 12 years ago

Closed 9 years ago

#25299 closed defect (bug) (invalid)

Customizer color picker "clear" button not reset the value to default

Reported by: zaherdirkey's profile zaherdirkey Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.6.1
Component: Customize Keywords: reporter-feedback
Focuses: Cc:

Description (last modified by SergeyBiryukov)

While useing in customize the theme WP_Customize_Color_Control
Clear button reset the value but not saved after Save/publish
Refresh the page to check if it is not saved.

    $wp_customize->add_setting('user_color', array(
        'default'           => null,
        'sanitize_callback' => 'sanitize_hex_color',
        'capability'        => 'edit_theme_options',
        'type'              => 'theme_mod',
        'transport'         => 'postMessage'

    ));

    $wp_customize->add_control(new WP_Customize_Color_Control($wp_customize, 'user_color', array(
          'settings' => 'user_color',
          'label'    => __('User Color', 'metallic'),
          'section'  => 'metallic_options'
        )
      )
    );

Attachments (1)

Customize Metallic — WordPress.png (80.3 KB) - added by zaherdirkey 11 years ago.
Custom Color Clear button

Download all attachments as: .zip

Change History (7)

#1 @SergeyBiryukov
12 years ago

  • Description modified (diff)
  • Keywords color picker removed

#3 @westonruter
11 years ago

By “Clear” button do you mean the “Default” button?

#4 @westonruter
11 years ago

  • Keywords reporter-feedback added

@zaherdirkey
11 years ago

Custom Color Clear button

#5 @zaherdirkey
11 years ago

It is appear to me "Clear" button but yes I need this button to reset it to the default, and the default value for my example is null mean "do not use it".

And this my project on github
https://github.com/parmaja/wp_metallic

#6 @chriscct7
9 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed

This is an issue caused by custom code, to create a behavior not supported by WordPress core. In this case, the plugin involved needs to implement it's own save method or use it's own colorpicker

Note: See TracTickets for help on using tickets.