widget_cssclass = 'widget_blogbyte_social_menu'; $this->widget_description = __( 'Displays social menu if you have set it.', 'blogbyte' ); $this->widget_id = 'blogbyte_social_menu'; $this->widget_name = __( 'Blogbyte: Social Menu', 'blogbyte' ); $this->settings = array( 'title' => array( 'type' => 'text', 'label' => __( 'Title', 'blogbyte' ), ), 'color' => array( 'type' => 'select', 'label' => __( 'Social Links Color', 'blogbyte' ), 'options' => array( 'theme_color' => __( 'Use Theme Color', 'blogbyte' ), 'brand_color' => __( 'Use Brand Color', 'blogbyte' ), ), 'std' => 'theme_color', ), 'style' => array( 'type' => 'select', 'label' => __( 'Style', 'blogbyte' ), 'options' => blogbyte_get_social_links_styles(), 'std' => 'style_1', ), 'show_label' => array( 'type' => 'checkbox', 'label' => __( 'Show Label', 'blogbyte' ), 'std' => false, ), 'column' => array( 'type' => 'select', 'label' => __( 'Column', 'blogbyte' ), 'desc' => __( 'Will only work when label is enabled from above and there is enough space to display the columns.', 'blogbyte' ), 'options' => array( 'one' => __( 'One', 'blogbyte' ), 'two' => __( 'Two', 'blogbyte' ), 'three' => __( 'Three', 'blogbyte' ), ), 'std' => 'two', ), 'align' => array( 'type' => 'select', 'label' => __( 'Alignment', 'blogbyte' ), 'options' => array( 'left' => __( 'Left', 'blogbyte' ), 'center' => __( 'Center', 'blogbyte' ), 'right' => __( 'Right', 'blogbyte' ), ), 'std' => 'left', ), ); parent::__construct(); add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_assets' ) ); } /** * Output widget. * * @see WP_Widget * * @param array $args * @param array $instance */ public function widget( $args, $instance ) { ob_start(); $this->widget_start( $args, $instance ); do_action( 'blogbyte_before_social_menu' ); $wrapper_class = isset( $instance['align'] ) ? $instance['align'] : $this->settings['align']['std']; ?> widget_end( $args ); echo ob_get_clean(); } public function enqueue_assets() { blogbyte_widget_css( $this->id_base, 'social-menu' ); } }