esc_html__( 'Add a separator element to your widget areas', 'mkdf-core' ) ) ); $this->setParams(); } protected function setParams() { $this->params = array( array( 'type' => 'dropdown', 'name' => esc_html__( 'type', 'mkdf-core' ), 'title' => esc_html__( 'Type', 'mkdf-core' ), 'options' => array( 'normal' => esc_html__( 'Normal', 'mkdf-core' ), 'full-width' => esc_html__( 'Full Width', 'mkdf-core' ) ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'position', 'mkdf-core' ), 'title' => esc_html__( 'Position', 'mkdf-core' ), 'options' => array( 'center' => esc_html__( 'Center', 'mkdf-core' ), 'left' => esc_html__( 'Left', 'mkdf-core' ), 'right' => esc_html__( 'Right', 'mkdf-core' ) ) ), array( 'type' => 'dropdown', 'name' => esc_html__( 'border_style', 'mkdf-core' ), 'title' => esc_html__( 'Style', 'mkdf-core' ), 'options' => array( 'solid' => esc_html__( 'Solid', 'mkdf-core' ), 'dashed' => esc_html__( 'Dashed', 'mkdf-core' ), 'dotted' => esc_html__( 'Dotted', 'mkdf-core' ) ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'color', 'mkdf-core' ), 'title' => esc_html__( 'Color', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'width', 'mkdf-core' ), 'title' => esc_html__( 'Width (px or %)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'thickness', 'mkdf-core' ), 'title' => esc_html__( 'Thickness (px)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'top_margin', 'mkdf-core' ), 'title' => esc_html__( 'Top Margin (px or %)', 'mkdf-core' ) ), array( 'type' => 'textfield', 'name' => esc_html__( 'bottom_margin', 'mkdf-core' ), 'title' => esc_html__( 'Bottom Margin (px or %)', 'mkdf-core' ) ) ); } public function widget( $args, $instance ) { if ( ! is_array( $instance ) ) { $instance = array(); } //prepare variables $params = ''; //is instance empty? if ( is_array( $instance ) && count( $instance ) ) { //generate shortcode params foreach ( $instance as $key => $value ) { $params .= " $key='$value' "; } } echo '
'; echo do_shortcode( "[mkdf_separator $params]" ); // XSS OK echo '
'; } } }