'widget_featured_galleries', 'description' => _x( 'Enter ids of galleries you want to feature.', 'Description of the featured galleries widget', 'bornholm' ) ); parent::__construct( 'featured-galleries', _x( 'Featured Galleries', 'Name of the featured galleries widget', 'bornholm' ), $widget_ops ); } public function widget( $args, $instance ) { $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? '' : $instance['title'], $instance, $this->id_base ); $gallery_ids = ! empty( $instance['gallery_ids'] ) ? explode( ',', $instance['gallery_ids'] ) : array(); $counter = 0; foreach ( $gallery_ids as $gallery_id ) { $post = get_post( $gallery_id ); $format = get_post_format( $gallery_id ); if ( $post && $format == 'gallery' ) { if ( $counter == 0 ) { echo $args['before_widget']; if ( $title ) { echo $args['before_title'] . $title . $args['after_title']; } } $images = bornholm_get_gallery_images( $gallery_id ); $hide_gallery_titles_on_featured_galleries_widget = get_theme_mod( 'hide_gallery_titles_on_featured_galleries_widget' ); ?>