esc_html__( 'Add custom font element to widget areas', 'mkdf-core' ) ) ); $this->setParams(); } protected function setParams() { $this->params = array( array( 'type' => 'textfield', 'name' => esc_html__( 'custom_class', 'mkdf-core' ), 'title' => esc_html__( 'Custom CSS Class', 'mkdf-core' ), 'description' => esc_html__( 'Style particular content element differently - add a class name and refer to it in custom CSS', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'title', 'mkdf-core' ), 'title' => esc_html__( 'Title Text', 'mkdf-core' ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'title_tag', 'mkdf-core' ), 'title' => esc_html__( 'Title Tag', 'mkdf-core' ), 'options' => staffscout_mikado_get_title_tag( true, array( 'p' => 'p' ) ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_family', 'mkdf-core' ), 'title' => esc_html__( 'Font Family', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_size', 'mkdf-core' ), 'title' => esc_html__( 'Font Size (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'line_height', 'mkdf-core' ), 'title' => esc_html__( 'Line Height (px or em)', 'mkdf-core' ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'font_weight', 'mkdf-core' ), 'title' => esc_html__( 'Font Weight', 'mkdf-core' ), 'options' => staffscout_mikado_get_font_weight_array( true ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'font_style', 'mkdf-core' ), 'title' => esc_html__( 'Font Style', 'mkdf-core' ), 'options' => staffscout_mikado_get_font_style_array( true ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'letter_spacing', 'mkdf-core' ), 'title' => esc_html__( 'Letter Spacing (px or em)', 'mkdf-core' ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'text_transform', 'mkdf-core' ), 'title' => esc_html__( 'Text Transform', 'mkdf-core' ), 'options' => staffscout_mikado_get_text_transform_array( true ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'text_decoration', 'mkdf-core' ), 'title' => esc_html__( 'Text Decoration', 'mkdf-core' ), 'options' => staffscout_mikado_get_text_decorations( true ) ), array( 'type' => 'colorpicker', 'name' => esc_html__( 'color', 'mkdf-core' ), 'title' => esc_html__( 'Color', 'mkdf-core' ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'text_align', 'mkdf-core' ), 'title' => esc_html__( 'Text Align', 'mkdf-core' ), 'options' => array( '' => esc_html__( 'Default', 'mkdf-core' ), 'left' => esc_html__( 'Left', 'mkdf-core' ), 'center' => esc_html__( 'Center', 'mkdf-core' ), 'right' => esc_html__( 'Right', 'mkdf-core' ), 'justify' => esc_html__( 'Justify', 'mkdf-core' ) ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'margin', 'mkdf-core' ), 'title' => esc_html__( 'Margin (px or %)', 'mkdf-core' ), 'description' => esc_html__( 'Insert margin in format: top right bottom left (e.g. 10px 5px 10px 5px)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_size_1280', 'mkdf-core' ), 'title' => esc_html__( 'Small Laptops Font Size (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'line_height_1280', 'mkdf-core' ), 'title' => esc_html__( 'Small Laptops Line Height (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_size_1024', 'mkdf-core' ), 'title' => esc_html__( 'Tablets Landscape Font Size (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'line_height_1024', 'mkdf-core' ), 'title' => esc_html__( 'Tablets Landscape Line Height (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_size_768', 'mkdf-core' ), 'title' => esc_html__( 'Tablets Portrait Font Size (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'line_height_768', 'mkdf-core' ), 'title' => esc_html__( 'Tablets Portrait Line Height (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'font_size_680', 'mkdf-core' ), 'title' => esc_html__( 'Mobiles Font Size (px or em)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'line_height_680', 'mkdf-core' ), 'title' => esc_html__( 'Mobiles Line Height (px or em)', 'mkdf-core' ) ) ); } public function widget( $args, $instance ) { $params = ''; if ( ! is_array( $instance ) ) { $instance = array(); } // Filter out all empty params $instance = array_filter( $instance, function ( $array_value ) { return trim( $array_value ) != ''; } ); // Generate shortcode params foreach ( $instance as $key => $value ) { $params .= " $key='$value' "; } echo '
'; echo do_shortcode( "[mkdf_custom_font $params]" ); // XSS OK echo '
'; } } }