__( 'Feature a page and display its excerpt and post thumbnail.', 'a-featured-page-widget' ) ) ); } /** * Outputs the content for a new widget instance. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ function widget( $args, $instance ) { extract( $args ); if ( isset( $instance['page'] ) && $instance['page'] != -1 ) { $page_id = (int) $instance['page']; $link_text = isset( $instance['link-text'] ) ? strip_tags( $instance['link-text'] ) : apply_filters( 'afpw_link_text', __( 'Continue reading', 'a-featured-page-widget' ) ); $image_size = isset( $instance['image-size'] ) ? strip_tags( $instance['image-size'] ) : 'thumbnail'; $p = new WP_Query( array( 'page_id' => $page_id ) ); if ( $p->have_posts() ) { $p->the_post(); $title = apply_filters( 'widget_title', empty( $instance['title'] ) ? get_the_title() : $instance['title'], $instance, $this->id_base ); echo $before_widget; echo $before_title; echo $title; echo $after_title; ?>
>

tag */ $args = array( 'depth' => 0, 'child_of' => 0, 'selected' => $page, 'name' => $this->get_field_name( 'page' ), 'id' => $this->get_field_id( 'page' ), 'show_option_none' => '', 'show_option_no_change' => '', 'option_none_value' => '' ); extract( $args, EXTR_SKIP ); $pages = get_pages( $args ); if ( ! empty( $pages ) ) : ?>