示例#1
0
 /**
  *
  * request is $_GET data
  *
  * @access private
  * @return boolean if the request is $_GET return true else false
  */
 private function isGet($name)
 {
     //TODO has_var
     if (\is_null(Filter::get_var($name))) {
         return false;
     }
     return true;
 }
示例#2
0
 /**
  * Add taxonomy filter to the admin page in post type lists
  *
  * @link   https://pippinsplugins.com/post-list-filters-for-custom-taxonomies-in-manage-posts/
  * @access public
  * @return void
  */
 public function filterAdminPostsTypeList()
 {
     global $typenow;
     // An array of all the taxonomyies you want to display. Use the taxonomy name or slug
     // must set this to the post type you want the filter(s) displayed on
     foreach ($this->getPostsTypesNames() as $post_type_name) {
         if ($typenow == $post_type_name) {
             $taxonomies = \get_object_taxonomies($typenow);
             foreach ($taxonomies as $tax_slug) {
                 $tax_obj = \get_taxonomy($tax_slug);
                 if (\wp_count_terms($tax_slug)) {
                     \wp_dropdown_categories(array('show_option_all' => Translate::translate('Show All ' . $tax_obj->label), 'taxonomy' => $tax_slug, 'name' => $tax_obj->name, 'orderby' => 'name', 'selected' => Filter::get_var($tax_slug), 'hierarchical' => $tax_obj->hierarchical, 'show_count' => false, 'hide_empty' => true));
                 }
             }
         }
     }
 }