/** * Factory method * @return MslsContentTypes */ public static function create() { $_request = MslsPlugin::get_superglobals(array('taxonomy')); if ('' != $_request['taxonomy']) { return MslsTaxonomy::instance(); } return MslsPostType::instance(); }
/** * Constructor */ public function __construct() { $this->types = array_merge(array('category', 'post_tag'), get_taxonomies(array('public' => true, '_builtin' => false), 'names', 'and')); $_request = MslsPlugin::get_superglobals(array('taxonomy', 'post_type')); if ('' != $_request['taxonomy']) { $this->request = esc_attr($_request['taxonomy']); $this->post_type = esc_attr($_request['post_type']); } else { $this->request = get_query_var('taxonomy'); } }
/** * Constructor * @uses get_post_types */ public function __construct() { $this->types = array_merge(array('post', 'page'), get_post_types(array('public' => true, '_builtin' => false), 'names', 'and')); $_request = MslsPlugin::get_superglobals(array('post_type')); if ('' != $_request['post_type']) { $this->request = esc_attr($_request['post_type']); } else { $this->request = get_post_type(); if (!$this->request) { $this->request = 'post'; } } }