'widget-promoted-pages', 'description' => esc_html__( 'Displays in a grid and links to multiple static pages. Best used in the \'Homepage: Content Widgets\' widgetized area.', 'bradbury' ) ) ); } public function widget( $args, $instance ) { extract( $args ); $i = 0; $z = 0; $max = 4; while ( $z < $max ) { $z++; $page_temp_id = 'page' . $z; if ( !isset($instance[$page_temp_id]) || $instance[$page_temp_id] == 0 ) { continue; } $page_settings[$i]['page_id'] = (int) $instance[$page_temp_id]; $i++; } /* User-selected settings. */ $title = apply_filters( 'widget_title', empty($instance['widget_title']) ? '' : $instance['widget_title'], $instance ); $show_title = isset($instance['show_title']) ? $instance['show_title'] : false; $show_excerpt = isset($instance['show_excerpt']) ? $instance['show_excerpt'] : false; $show_photo = isset($instance['show_photo']) ? $instance['show_photo'] : false; $show_button = isset($instance['show_button']) ? $instance['show_button'] : false; $show_num = isset($page_settings) ? count($page_settings) : 0; if ( !isset($show_num) && ( $show_num != 3 ) ) { $show_num = 3; } $thumb_name = 'thumb-featured-page'; $i = 0; $max = count($page_settings); $z = 0; /* Before widget (defined by themes). */ echo $before_widget; ?> __('Widget Title','bradbury'), 'page1' => 0, 'page2' => 0, 'page3' => 0, 'page4' => 0, 'show_title' => 1, 'show_excerpt' => 1, 'show_photo' => 1, 'show_button' => 0 ); $instance = wp_parse_args( (array) $instance, $defaults ); ?>


id="get_field_id('show_photo'); ?>" name="get_field_name('show_photo'); ?>" />

id="get_field_id('show_title'); ?>" name="get_field_name('show_title'); ?>" />

id="get_field_id('show_excerpt'); ?>" name="get_field_name('show_excerpt'); ?>" />

id="get_field_id('show_button'); ?>" name="get_field_name('show_button'); ?>" />