function __construct($args = array()) { parent::__construct($args); add_shortcode('progress_bar', array($this, 'progress_bar')); add_shortcode('themify_progress_bar', array($this, 'progress_bar')); add_shortcode($this->post_type . '-social', array($this, 'social')); add_shortcode('themify_' . $this->post_type . '-social', array($this, 'social')); }
function manage_and_filter() { parent::manage_and_filter(); add_action('admin_init', array($this, 'add_menu_meta_box')); }
/** * Select form element to filter the post list * @return string HTML */ public function get_select() { if (!self::$run_once) { return; } self::$run_once = false; $html = ''; foreach ($this->taxonomies as $tax) { $options = sprintf('<option value="">%s %s</option>', __('View All', 'themify'), get_taxonomy($tax)->label); $class = is_taxonomy_hierarchical($tax) ? ' class="level-0"' : ''; foreach (get_terms($tax) as $taxon) { $options .= sprintf('<option %s%s value="%s">%s%s</option>', isset($_GET[$tax]) ? selected($taxon->slug, $_GET[$tax], false) : '', '0' !== $taxon->parent ? ' class="level-1"' : $class, $taxon->slug, '0' !== $taxon->parent ? str_repeat(' ', 3) : '', "{$taxon->name} ({$taxon->count})"); } $html .= sprintf('<select name="%s" id="%s" class="postform">%s</select>', $tax, $tax, $options); } return print $html; }