/** * Output the widget * * @see WP_Widget::widget() */ public function widget($args, $instance) { extract($args); $title = apply_filters('widget_title', $instance['title'], $instance, $this->id_base); if (strstr($instance['block'], 'blog-')) { $shortcode = 'blog'; // set listing type $instance['type'] = str_replace('blog-', '', $instance['block']); } else { $shortcode = $instance['block']; } // supported attributes $attrs = array('posts', 'type', 'cats', 'tags', 'sort_order', 'sort_by', 'offset', 'post_type', 'pagination_type'); $helper = new Bunyad_PageBuilder_WidgetBase(null, null, array()); // output echo $before_widget . $before_title . $title . $after_title; // create and execute the shortcode echo do_shortcode("[{$shortcode} " . implode(' ', $helper->shortcode_attribs($instance, $attrs)) . ' /]'); echo $after_widget; }
public function __construct() { parent::__construct('bunyad_pagebuilder_blog', __('Blog/Listing Block', 'bunyad-admin'), array('description' => __('Used for category style listing - ex. a blog view. Supports pagination.', 'bunyad-admin'))); }
public function __construct() { parent::__construct('bunyad_pagebuilder_latest_gallery', __('Latest Gallery Carousel', 'bunyad-admin'), array('description' => __('Show latest videos or galleries in a carousel.', 'bunyad-admin'))); }
public function __construct() { parent::__construct('bunyad_pagebuilder_highlights', __('Highlights Block', 'bunyad-admin'), array('description' => __('A 2 or 3 column block to highlight the latest post and show more posts from 2 or 3 categories.', 'bunyad-admin'))); }
public function __construct() { parent::__construct('bunyad_pagebuilder_focus_grid', __('Focus Grid Block', 'bunyad-admin'), array('description' => __('A block that lists news from a parent categories, making the latest one prominent, and have tabs for sub-categories.', 'bunyad-admin'))); }