'classifyed_widget_social', 'description' => esc_html__( 'Social Icons Widget', 'classifyed' ), ); parent::__construct( 'classifyed-social', esc_html__( 'Classifyed: Social', 'classifyed' ), $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 ); 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 '