diff --git a/customizer/alpha-color-picker/alpha-color-picker.php b/customizer/alpha-color-picker/alpha-color-picker.php index 483d3f4..eefceb1 100644 --- a/customizer/alpha-color-picker/alpha-color-picker.php +++ b/customizer/alpha-color-picker/alpha-color-picker.php @@ -46,16 +46,22 @@ class Customize_Alpha_Color_Control extends WP_Customize_Control { * stand alone class we'll register and enqueue them here. */ public function enqueue() { + + $default_script_location = get_template_directory_uri() . '/admin/customizer/alpha-color-picker/alpha-color-picker.js'; + wp_enqueue_script( 'alpha-color-picker', - get_stylesheet_directory_uri() . '/admin/customizer/alpha-color-picker/alpha-color-picker.js', + apply_filters('alpha-color-picker-scripts', $default_script_location), array( 'jquery', 'wp-color-picker' ), '1.0.0', true ); + + $default_styles_location = get_template_directory_uri() . '/admin/customizer/alpha-color-picker/alpha-color-picker.css'; + wp_enqueue_style( 'alpha-color-picker', - get_stylesheet_directory_uri() . '/admin/customizer/alpha-color-picker/alpha-color-picker.css', + apply_filters('alpha-color-picker-styles', $default_styles_location), array( 'wp-color-picker' ), '1.0.0' ); @@ -70,24 +76,28 @@ public function render_content() { if ( is_array( $this->palette ) ) { $palette = implode( '|', $this->palette ); } else { - // Default to true. + // Default to true $palette = ( false === $this->palette || 'false' === $this->palette ) ? 'false' : 'true'; } // Support passing show_opacity as string or boolean. Default to true. $show_opacity = ( false === $this->show_opacity || 'false' === $this->show_opacity ) ? 'false' : 'true'; - // Begin the output. ?> - + // Output the label if passed in + if ( isset( $this->label ) && '' !== $this->label ) { + echo '' . sanitize_text_field( $this->label ) . ''; + } + + // Output the description if passed in + if ( isset( $this->description ) && '' !== $this->description ) { + echo '' . sanitize_text_field( $this->description ) . ''; + } + ?> +
+ +