'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 = 3; while ( $z < $max ) { $z++; $page_temp_id = 'page' . $z; if ( !$instance[$page_temp_id] ) { 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 = $instance['show_title']; $show_excerpt = $instance['show_excerpt']; $show_photo = $instance['show_photo']; $show_button = $instance['show_button']; $show_num = count($page_settings); if ( !isset($show_num) && ( $show_num != 3 ) ) { $show_num = 3; } $thumb_name = 'thumb-featured-page'; $thumb_width = 530; $thumb_height = 350; $i = 0; $max = count($page_settings); $z = 0; /* Before widget (defined by themes). */ echo $before_widget; ?> 0, 'page2' => 0, 'page3' => 0, 'show_title' => 'on', 'show_excerpt' => 'on', 'show_photo' => 'on', 'show_button' => 'on'); $instance = wp_parse_args( (array) $instance, $defaults ); $instance['widget_title'] = sanitize_text_field( $instance['widget_title'] ); $instance['page1'] = absint( $instance['page1'] ); $instance['page2'] = absint( $instance['page2'] ); $instance['page3'] = absint( $instance['page3'] ); $instance['show_title'] = isset( $instance['show_title'] ) ? (bool) $instance['show_title'] : true; $instance['show_photo'] = isset( $instance['show_photo'] ) ? (bool) $instance['show_photo'] : true; $instance['show_button'] = isset( $instance['show_button'] ) ? (bool) $instance['show_button'] : true; $instance['show_excerpt'] = isset( $instance['show_excerpt'] ) ? (bool) $instance['show_excerpt'] : true; ?>


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'); ?>" />