'buntu_widget_social', 'description' => esc_html__( 'Social Icons Widget', 'buntu' ), ); parent::__construct( 'buntu-social', esc_html__( 'Buntu: Social', 'buntu' ), $opts ); } /** * Echo the widget content. * * @since 1.0.0 * * @param array $args Display arguments including before_title, after_title, * before_widget, and after_widget. * @param array $instance The settings for the particular instance of the widget. */ function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $size = ! empty( $instance['size'] ) ? $instance['size'] : 'medium'; echo $args['before_widget']; // Render title. if ( ! empty( $title ) ) { echo $args['before_title'] . $title . $args['after_title']; } $nav_menu_locations = get_nav_menu_locations(); $menu_id = 0; if ( isset( $nav_menu_locations['social'] ) && absint( $nav_menu_locations['social'] ) > 0 ) { $menu_id = absint( $nav_menu_locations['social'] ); } if ( $menu_id > 0 ) { $menu_items = wp_get_nav_menu_items( $menu_id ); if ( ! empty( $menu_items ) ) { echo '
dropdown_size( array( 'id' => $this->get_field_id( 'size' ), 'name' => $this->get_field_name( 'size' ), 'selected' => $size, ) ); ?>
'', 'name' => '', 'selected' => 0, 'echo' => 1, ); $r = wp_parse_args( $args, $defaults ); $output = ''; $choices = array( 'small' => __( 'Small', 'buntu' ), 'medium' => __( 'Medium', 'buntu' ), 'large' => __( 'Large', 'buntu' ), 'extra-large' => __( 'Extra Large', 'buntu' ), ); if ( ! empty( $choices ) ) { $output = "\n"; } if ( $r['echo'] ) { echo $output; } return $output; } } endif;