description ) ) : ?>
description; ?>
';
// Output the label and description if they were passed in.
if ( isset( $this->label ) && '' !== $this->label ) {
echo '' . sanitize_text_field( $this->label ) . '';
}
if ( isset( $this->description ) && '' !== $this->description ) {
echo '' . sanitize_text_field( $this->description ) . '';
}
// Process the palette
if ( is_array( $this->palette ) ) {
$palette = implode( '|', $this->palette );
} else {
// 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.
?>
link() ); ?> />
';
}
}
/**
* Gradient Color Customizer Control
*
* Class BetterDocs_Customizer_Gradient_Color_Control
*
* @since 1.0.0
*/
class BetterDocs_Customizer_Gradient_Color_Control extends WP_Customize_Control {
/**
* Official control name.
*
* @var string
*/
public $type = 'batterdocs-gradient-color';
/**
* Add support for palettes to be passed in.
*
* Supported palette values are true, false, or an array of RGBa and Hex colors.
*
* @var bool
*/
public $palette;
/**
* Add support for showing the opacity value on the slider handle.
*
* @var array
*/
public $show_opacity;
public $defaults;
public $directions;
/**
* Enqueue scripts/styles.
*
* @since 1.0.0
*
*/
public function enqueue() {
wp_enqueue_script(
'betterdocs-customizer-alpha-color-picker',
BETTERDOCS_ADMIN_URL . 'assets/js/alpha-color-picker.js',
array( 'jquery', 'wp-color-picker' ),
rand(),
true
);
wp_enqueue_style(
'betterdocs-customizer-alpha-color-picker',
BETTERDOCS_ADMIN_URL . 'assets/css/alpha-color-picker.css',
array( 'wp-color-picker' ),
rand()
);
wp_enqueue_script(
'betterdocs-customizer-range-value-control',
BETTERDOCS_ADMIN_URL . 'assets/js/customizer-range-value-control.js',
array( 'jquery' ),
rand(),
true
);
wp_enqueue_style(
'betterdocs-customizer-range-value-control', BETTERDOCS_ADMIN_URL . 'assets/css/customizer-range-value-control.css',
array(),
rand()
);
wp_enqueue_script(
'betterdocs-customizer-gradient-control',
BETTERDOCS_ADMIN_URL . 'assets/js/customizer-gradient-control.js',
array( 'jquery' ),
rand(),
true
);
}
/**
* Render the control.
*/
public function render_content() {
echo '
';
// Output the label and description if they were passed in.
if ( isset( $this->label ) && '' !== $this->label ) {
echo '' . sanitize_text_field( $this->label ) . '';
}
if ( isset( $this->description ) && '' !== $this->description ) {
echo '' . sanitize_text_field( $this->description ) . '';
}
// Process the palette
if ( is_array( $this->palette ) ) {
$palette = implode( '|', $this->palette );
} else {
// 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.
if( $this->value() ) {
if ( is_array ($this->value())) {
$gradient_val = $this->value();
} else {
$gradient_val = (array) json_decode($this->value());
}
} else {
$gradient_val = $this->defaults;
}
?>
directions ) : ?>
0
';
}
}
/**
* Seperator Custom Customizer Control
*
* Class BetterDocs_Separator_Custom_Control
*
* @since 1.0.0
*/
class BetterDocs_Separator_Custom_Control extends WP_Customize_Control{
public $type = 'separator';
public function render_content(){
?>