display = array( 'background' => array(), 'color' => array(), 'border' => array(), ); parent::__construct( $manager, $id, $args ); } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { parent::enqueue(); // Script debug. $bloghash_suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min'; // Enqueue WordPress color picker styles. wp_enqueue_style( 'wp-color-picker' ); // Enqueue background image stylesheet. if ( isset( $this->display['background'] ) ) { wp_enqueue_style( 'bloghash-background-control-style', BLOGHASH_THEME_URI . '/inc/customizer/controls/background/background' . $bloghash_suffix . '.css', false, BLOGHASH_THEME_VERSION, 'all' ); } } /** * Refresh the parameters passed to the JavaScript via JSON. * * @see WP_Customize_Control::to_json() */ public function to_json() { parent::to_json(); $this->json['display'] = $this->display; $this->json['icon'] = $this->icon; $this->json['l10n'] = array( 'background-type' => esc_html__( 'Type', 'bloghash' ), 'gradient' => array( 'color-1' => esc_html__( 'Color 1', 'bloghash' ), 'color-2' => esc_html__( 'Color 2', 'bloghash' ), 'color-location' => esc_html__( 'Location', 'bloghash' ), 'type' => esc_html__( 'Type', 'bloghash' ), 'linear' => esc_html__( 'Linear', 'bloghash' ), 'radial' => esc_html__( 'Radial', 'bloghash' ), 'angle' => esc_html__( 'Angle', 'bloghash' ), 'position' => esc_html__( 'Position', 'bloghash' ), 'radial-position' => array( 'center center' => esc_html__( 'Center Center', 'bloghash' ), 'center left' => esc_html__( 'Center Left', 'bloghash' ), 'center right' => esc_html__( 'Center Right', 'bloghash' ), 'top center' => esc_html__( 'Top Center', 'bloghash' ), 'top left' => esc_html__( 'Top Left', 'bloghash' ), 'top right' => esc_html__( 'Top Right', 'bloghash' ), 'bottom center' => esc_html__( 'Bottom Center', 'bloghash' ), 'bottom left' => esc_html__( 'Bottom Left', 'bloghash' ), 'bottom right' => esc_html__( 'Bottom Right', 'bloghash' ), ), ), 'image' => array( 'placeholder' => __( 'No image selected', 'bloghash' ), 'less' => __( 'Less Settings', 'bloghash' ), 'more' => __( 'Advanced', 'bloghash' ), 'select_image' => __( 'Select Image', 'bloghash' ), 'use_image' => __( 'Use This Image', 'bloghash' ), ), 'border-styles' => array( 'solid' => esc_html__( 'Solid', 'bloghash' ), 'dotted' => esc_html__( 'Dotted', 'bloghash' ), 'dashed' => esc_html__( 'Dashed', 'bloghash' ), ), ); } /** * An Underscore (JS) template for this control's content (but not its container). * * Class variables for this control class are available in the `data` JS object; * export custom variables by overriding {@see WP_Customize_Control::to_json()}. * * @see WP_Customize_Control::print_template() */ protected function content_template() { ?>