'swift_staff_widget_latest_jobs', 'description' => __('Swift staff latest jobs.'), 'customize_selective_refresh' => true, ); parent::__construct('swift_staff_latest_jobs', __('Latest Jobs'), $widget_ops); } /** * Outputs the content for the current latest jobs widget instance. * * @param array $args Display arguments including 'before_title', 'after_title', * 'before_widget', and 'after_widget'. * @param array $instance Settings for the current Recent Posts widget instance. */ public function widget($args, $instance) { if (!isset($args['widget_id'])) { $args['widget_id'] = $this->id; } $title = (!empty($instance['title']) ) ? $instance['title'] : __('Latest Jobs'); $title = apply_filters('widget_title', $title, $instance, $this->id_base); $number = (!empty($instance['number']) ) ? absint($instance['number']) : 5; if (!$number) $number = 5; $show_date = isset($instance['show_date']) ? $instance['show_date'] : false; /** * Filters the arguments for the Recent Jobs widget. * * @param array $args An array of arguments used to retrieve the recent posts. */ $latest_jobs_args = array( 'post_type' => 'swift_jobs', 'post_status' => 'publish', 'posts_per_page' => $number, 'orderby' => 'date', 'order' => 'DESC', 'no_found_rows' => true, ); $r = new WP_Query($latest_jobs_args); if ($r->have_posts()) : ?>
id="get_field_id('show_date'); ?>" name="get_field_name('show_date'); ?>" />