Ejemplo n.º 1
0
 static function registerPostType()
 {
     Register_Post_Type(self::$post_type_name, array('labels' => array('name' => Glossary_Type::$type->label, 'singular_name' => I18n::t('Термін'), 'add_new' => I18n::t('Додати термін'), 'add_new_item' => I18n::t('Новий термін'), 'edit_item' => I18n::t('Редагувати термін'), 'view_item' => I18n::t('Показати термін'), 'search_items' => I18n::t('Пошук термінів'), 'not_found' => I18n::t('Термінів не знайдено'), 'not_found_in_trash' => I18n::t('У кошику Термінів не знайдено'), 'parent_item_colon' => ''), 'public' => True, 'show_ui' => True, 'menu_icon' => 'dashicons-welcome-learn-more', 'has_archive' => True, 'map_meta_cap' => True, 'hierarchical' => False, 'rewrite' => array('slug' => Glossary_Type::$type->slug, 'with_front' => False), 'supports' => array('title', 'editor', 'author', 'excerpt'), 'menu_position' => 20));
     # Add optionally post type support
     if (Options::Get('enable_custom_fields')) {
         Add_Post_Type_Support(self::$post_type_name, 'custom-fields');
     }
 }
Ejemplo n.º 2
0
 function Register_Post_Type()
 {
     # Register Post Type
     Register_Post_Type($this->name, array('labels' => array('name' => I18n::t('Galleries'), 'singular_name' => I18n::t('Gallery'), 'add_new' => I18n::t('Add Gallery'), 'add_new_item' => I18n::t('New Gallery'), 'edit_item' => I18n::t('Edit Gallery'), 'view_item' => I18n::t('View Gallery'), 'search_items' => I18n::t('Search Galleries'), 'not_found' => I18n::t('No Galleries found'), 'not_found_in_trash' => I18n::t('No Galleries found in Trash'), 'parent_item_colon' => ''), 'public' => True, 'show_ui' => True, 'has_archive' => !$this->core->options->Get('deactivate_archive'), 'map_meta_cap' => True, 'hierarchical' => False, 'rewrite' => array('slug' => I18n::t('galleries', 'URL slug'), 'with_front' => False), 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'comments', 'custom-fields'), 'menu_position' => 10, 'menu_icon' => 'dashicons-images-alt', 'register_meta_box_cb' => array($this, 'Add_Meta_Boxes')));
 }
 function Register_Gallery_Post_Type()
 {
     // Register Post Type
     Register_Post_Type($this->gallery_post_type, array('labels' => array('name' => $this->t('Galleries'), 'singular_name' => $this->t('Gallery'), 'add_new' => $this->t('Add Gallery'), 'add_new_item' => $this->t('New Gallery'), 'edit_item' => $this->t('Edit Gallery'), 'view_item' => $this->t('View Gallery'), 'search_items' => $this->t('Search Galleries'), 'not_found' => $this->t('No Galleries found'), 'not_found_in_trash' => $this->t('No Galleries found in Trash'), 'parent_item_colon' => ''), 'public' => True, 'show_ui' => True, 'has_archive' => !$this->get_option('deactivate_archive'), 'capability_type' => array('gallery', 'galleries'), 'map_meta_cap' => True, 'hierarchical' => False, 'rewrite' => array('slug' => $this->t('galleries', 'URL slug'), 'with_front' => False), 'supports' => array('title', 'author', 'excerpt', 'thumbnail', 'comments'), 'menu_position' => 10, 'register_meta_box_cb' => array($this, 'Add_Gallery_Meta_Boxes')));
 }