__( 'A widget that shows latest posts', 'accesspress-mag' ) ) ); } /** * Helper function that holds widget fields * Array is used in update and form functions */ private function widget_fields() { $fields = array( 'latest_posts_title' => array( 'accesspress_mag_widgets_name' => 'latest_posts_title', 'accesspress_mag_widgets_title' => __('Title', 'accesspress-mag'), 'accesspress_mag_widgets_field_type' => 'title', ), ); return $fields; } /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { extract( $args ); $latest_posts_title = $instance[ 'latest_posts_title' ]; echo $before_widget; ?>