__( 'Displays your Charitable campaigns.', 'charitable' ), 'customize_selective_refresh' => true, ) ); } /** * Display the widget contents on the front-end. * * @since 1.0.0 * * @param array $args The widget arguments. * @param array $instance The widget instance. */ public function widget( $args, $instance ) { $view_args = array_merge( $args, $instance ); $view_args['campaigns'] = $this->get_widget_campaigns( $instance ); charitable_template( 'widgets/campaigns.php', $view_args ); } /** * Display the widget form in the admin. * * @since 1.0.0 * * @param array $instance The current settings for the widget options. * @return void */ public function form( $instance ) { $defaults = array( 'title' => '', 'number' => 10, 'order' => 'recent', 'show_thumbnail' => false, ); $args = wp_parse_args( $instance, $defaults ); ?>

>

$number, ); if ( isset( $instance['order'] ) && 'recent' == $instance['order'] ) { $args['orderby'] = 'date'; $args['order'] = 'DESC'; return Charitable_Campaigns::query( $args ); } return Charitable_Campaigns::ordered_by_ending_soon( $args ); } } endif;