Пример #1
0
 /**
  * @return stdClass[]
  */
 public function getAllUsablePostTypes()
 {
     if (!$this->_cache->containsKey('usablePostTypes')) {
         $toIgnore = array('attachment', 'nav_menu_item', 'revision');
         $types = $this->_wpFunctions->get_post_types(array('public' => true), 'objects');
         $toReturn = array();
         foreach ($types as $type) {
             if (!in_array($type->name, $toIgnore)) {
                 $toReturn[] = $type;
             }
         }
         $this->_cache->put('usablePostTypes', $toReturn);
     }
     return $this->_cache->get('usablePostTypes');
 }