ast_inherit = __( 'Inherit', 'astra' ); parent::__construct( $manager, $id, $args ); } /** * Renders the content for a control based on the type * of control specified when this class is initialized. * * @since 1.0.0 * @access protected * @return void */ protected function render_content() { switch ( $this->type ) { case 'ast-font-family': $this->render_font( $this->ast_inherit ); break; case 'ast-font-weight': $this->render_font_weight( $this->ast_inherit ); break; } } /** * Enqueue control related scripts/styles. * * @access public */ public function enqueue() { $js_uri = ASTRA_THEME_URI . 'inc/customizer/custom-controls/typography/'; wp_enqueue_script( 'astra-typography', $js_uri . 'typography.js', array( 'jquery', 'customize-base' ), ASTRA_THEME_VERSION, true ); $astra_typo_localize = array( 'inherit' => __( 'Inherit', 'astra' ), '100' => __( 'Thin 100', 'astra' ), '200' => __( 'Extra-Light 200', 'astra' ), '300' => __( 'Light 300', 'astra' ), '400' => __( 'Normal 400', 'astra' ), '500' => __( 'Medium 500', 'astra' ), '600' => __( 'Semi-Bold 600', 'astra' ), '700' => __( 'Bold 700', 'astra' ), '800' => __( 'Extra-Bold 800', 'astra' ), '900' => __( 'Ultra-Bold 900', 'astra' ), ); wp_localize_script( 'astra-typography', 'astraTypo', $astra_typo_localize ); } /** * Renders the title and description for a control. * * @since 1.0.0 * @access protected * @return void */ protected function render_content_title() { if ( ! empty( $this->label ) ) { echo '' . esc_html( $this->label ) . ''; } if ( ! empty( $this->description ) ) { echo '' . esc_html( $this->description ) . ''; } } /** * Renders the connect attribute for a connected control. * * @since 1.0.0 * @access protected * @return void */ protected function render_connect_attribute() { if ( $this->connect ) { echo ' data-connected-control="' . esc_attr( $this->connect ) . '"'; echo ' data-inherit="' . esc_attr( $this->ast_inherit ) . '"'; } } /** * Renders a font control. * * @since 1.0.16 Added the action 'astra_customizer_font_list' to support custom fonts. * @since 1.0.0 * @param string $default Inherit/Default. * @access protected * @return void */ protected function render_font( $default ) { echo ''; } /** * Renders a font weight control. * * @since 1.0.0 * @param string $default Inherit/Default. * @access protected * @return void */ protected function render_font_weight( $default ) { echo ''; } }