/** * __construct * * Constructor * */ public function __construct() { \Pressgang\Scripts::$scripts['mailchimp'] = array('src' => get_template_directory_uri() . '/js/src/custom/mailchimp.js', 'deps' => array('jquery'), 'ver' => '1.0', 'hook' => 'render_widget_mailchimp_signup'); $this->description = __("A simple widget that embeds a Mailchimp signup form", THEMENAME); add_action('wp_ajax_mailchimp_signup', array($this, 'signup')); add_action('wp_ajax_nopriv_mailchimp_signup', array($this, 'signup')); parent::__construct(); }
/** * widget * * @param array $args * @param array $instance */ public function widget($args, $instance) { $authors = get_users(array('orderby' => 'post_count', 'order' => 'DESC', 'who' => 'authors')); foreach ($authors as $i => &$author) { if (count_user_posts($author->ID)) { $author = new \TimberUser($author); } else { unset($authors[$i]); } } $instance['authors'] = $authors; parent::widget($args, $instance); }
/** * __construct * * Image Widget constructor. */ public function __construct() { $this->add_acf_fields(); parent::__construct(); }