Ejemplo n.º 1
0
function jogja_core_register_post_types()
{
    if (current_theme_supports('jogja-portfolio')) {
        register_extended_post_type('jogja-portfolio', array('admin_cols' => array('title' => array('title' => 'Project Name'), 'featured_image' => array('title' => 'Project Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'project_categories' => array('title' => 'Project Category', 'taxonomy' => 'project_categories'), 'date'), 'filters' => array('project_categories' => array('title' => 'Project Categories', 'taxonomy' => 'project_categories'), 'project_tags' => array('title' => 'Project Tags', 'taxonomy' => 'project_tags')), 'supports' => array('title', 'editor', 'thumbnail'), 'menu_icon' => 'dashicons-category', 'menu_position' => 7.25, 'has_archive' => false), array('singular' => 'Portfolio', 'plural' => 'Portfolios', 'slug' => 'project'));
        // Register Taxonomy project categories
        register_extended_taxonomy('project_categories', 'jogja-portfolio', array(), array('singular' => 'Category', 'plural' => 'Categories', 'slug' => 'project_cat'));
    }
    if (current_theme_supports('jogja-testimonials')) {
        register_extended_post_type('jogja-testimonials', array('admin_cols' => array('title' => array('title' => 'Name'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail'), 'menu_icon' => 'dashicons-format-chat', 'menu_position' => 8.25, 'has_archive' => false), array('singular' => 'Testimonial', 'plural' => 'Testimonials', 'slug' => 'testimony'));
    }
    if (current_theme_supports('jogja-slides')) {
        register_extended_post_type('jogja-slides', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail'), 'menu_icon' => 'dashicons-camera', 'menu_position' => 8.5, 'has_archive' => false), array('singular' => 'Slide', 'plural' => 'Slides', 'slug' => 'slide'));
    }
    if (current_theme_supports('jogja-galleries')) {
        register_extended_post_type('jogja-galleries', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail', 'editor'), 'menu_icon' => 'dashicons-format-image', 'menu_position' => 8.699999999999999, 'has_archive' => false), array('singular' => 'Gallery', 'plural' => 'Galleries', 'slug' => 'gallery'));
        // Register Taxonomy Gallery categories
        register_extended_taxonomy('gallery_cat', 'jogja-galleries', array(), array('singular' => 'Category', 'plural' => 'Categories', 'slug' => 'gallery_cat'));
    }
    if (current_theme_supports('jogja-events')) {
        register_extended_post_type('jogja-events', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail', 'editor'), 'menu_icon' => 'dashicons-calendar', 'menu_position' => 8.800000000000001, 'has_archive' => false), array('singular' => 'Event', 'plural' => 'Events', 'slug' => 'event'));
    }
    if (current_theme_supports('jogja-stories')) {
        register_extended_post_type('jogja-stories', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail', 'editor'), 'menu_icon' => 'dashicons-sticky', 'menu_position' => 8.9, 'has_archive' => false), array('singular' => 'Story', 'plural' => 'Stories', 'slug' => 'story'));
    }
    if (current_theme_supports('jogja-peoples')) {
        register_extended_post_type('jogja-peoples', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail', 'editor'), 'menu_icon' => 'dashicons-businessman', 'menu_position' => 8.99, 'has_archive' => false), array('singular' => 'People', 'plural' => 'Peoples', 'slug' => 'people'));
        register_extended_taxonomy('people-group', 'jogja-peoples', array(), array('singular' => 'Group', 'plural' => 'Groups', 'slug' => 'group'));
    }
    if (current_theme_supports('jogja-guestbook')) {
        register_extended_post_type('jogja-guestbook', array('admin_cols' => array('title' => array('title' => 'Title'), 'featured_image' => array('title' => 'Image', 'featured_image' => 'thumbnail', 'height' => 80, 'width' => 80), 'date'), 'supports' => array('title', 'thumbnail', 'editor'), 'menu_icon' => 'dashicons-format-chat', 'menu_position' => 8.993, 'has_archive' => false), array('singular' => 'Guest Book', 'plural' => 'Guest Books', 'slug' => 'guest-book'));
    }
}
Ejemplo n.º 2
0
 function __construct()
 {
     add_action('init', function () {
         if (!function_exists('register_extended_post_type')) {
             include_once $_SERVER['DOCUMENT_ROOT'] . '/../vendor/johnbillion/extended-cpts/extended-cpts.php';
         }
         if (function_exists('register_extended_post_type')) {
             register_extended_post_type('products', ['has_archive' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_feed' => true, 'supports' => array('title', 'editor', 'thumbnail'), 'taxonomies' => ['category'], 'rewrite' => true], ['singular' => 'Produkt', 'plural' => 'Produkter']);
         }
     });
 }
Ejemplo n.º 3
0
 function __construct()
 {
     add_action('init', function () {
         if (!function_exists('register_extended_post_type')) {
             $path = realpath($_SERVER['DOCUMENT_ROOT'] . '/../' . 'vendor/johnbillion/extended-cpts/');
             include_once $path . '/extended-cpts.php';
         }
         if (function_exists('register_extended_post_type')) {
             register_extended_post_type('module', ['has_archive' => false, 'show_ui' => true, 'show_in_menu' => true, 'show_in_feed' => false, 'supports' => array('title', 'editor', 'thumbnail')], ['singular' => __('Modul', 'aekab'), 'plural' => __('Moduler', 'aekab')]);
         }
     });
 }
Ejemplo n.º 4
0
 function __construct()
 {
     add_action('init', function () {
         //if( !function_exists('register_extended_post_type') ) {
         //    include_once( $_SERVER['DOCUMENT_ROOT'] . '/../vendor/johnbillion/extended-cpts/extended-cpts.php');
         //}
         if (function_exists('register_extended_post_type')) {
             register_extended_post_type('module', ['has_archive' => false, 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=page', 'show_in_feed' => false, 'rewrite' => ['slug' => 'lank', 'with_front' => false], 'supports' => array('title'), 'labels' => ['name' => __('Moduler', 'intra'), 'singular_name' => __('Modul', 'intra'), 'menu_name' => __('Moduler', 'intra'), 'name_admin_bar' => __('Modul', 'intra'), 'add_new' => __('Skapa ny', 'intra'), 'add_new_item' => __('Skapa ny modul', 'intra'), 'edit_item' => __('Ändra modul', 'intra'), 'new_item' => __('Ny modul', 'intra'), 'view_item' => __('Visa modul', 'intra'), 'search_items' => __('Sök moduler', 'intra'), 'not_found' => __('Inga moduler funna', 'intra'), 'not_found_in_trash' => __('Inga moduler i papperskorg', 'intra'), 'parent_item_colon' => __('Modulförälder:', 'intra'), 'all_items' => __('Moduler', 'intra'), 'archives' => __('Modularkiv', 'intra'), 'insert_into_item' => __('Lägg till i modul', 'intra'), 'uploaded_to_this_item' => __('Uppladdat till modul', 'intra'), 'filter_items_list' => __('Filtrera modullistan', 'intra'), 'items_list_navigation' => __('Listnavigering', 'intra'), 'items_list' => __('Modullista', 'intra')]], ['singular' => __('Modul', 'intra'), 'plural' => __('Moduler', 'intra')]);
             register_extended_post_type('link', ['has_archive' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_feed' => false, 'taxonomies' => ['category'], 'supports' => array('title', 'thumbnail'), 'labels' => ['name' => __('Länkar', 'intra'), 'singular_name' => __('Länk', 'intra'), 'menu_name' => __('Länkar', 'intra'), 'name_admin_bar' => __('Länk', 'intra'), 'add_new' => __('Skapa ny', 'intra'), 'add_new_item' => __('Skapa ny länk', 'intra'), 'edit_item' => __('Ändra länk', 'intra'), 'new_item' => __('Ny länk', 'intra'), 'view_item' => __('Visa länk', 'intra'), 'search_items' => __('Sök länkar', 'intra'), 'not_found' => __('Inga länkar funna', 'intra'), 'not_found_in_trash' => __('Inga länkar i papperskorg', 'intra'), 'parent_item_colon' => __('Länkförälder:', 'intra'), 'all_items' => __('Länkar', 'intra'), 'archives' => __('Länkarkiv', 'intra'), 'insert_into_item' => __('Lägg till i modul', 'intra'), 'uploaded_to_this_item' => __('Uppladdat till länk', 'intra'), 'filter_items_list' => __('Filtrera länklistan', 'intra'), 'items_list_navigation' => __('Listnavigering', 'intra'), 'items_list' => __('Länklista', 'intra')]], ['singular' => __('Länk', 'intra'), 'plural' => __('Länkar', 'intra')]);
         }
     });
 }
Ejemplo n.º 5
0
 protected function register_post_types()
 {
     global $wp_rewrite;
     $wp_rewrite->init();
     $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
     $this->args['hello'] = array('site_sortables' => array('test_site_sortables_post_meta' => array('meta_key' => 'test_meta_key'), 'test_site_sortables_post_field' => array('post_field' => 'name'), 'test_site_sortables_taxonomy' => array('taxonomy' => 'hello_category')), 'admin_cols' => array('test_admin_cols_post_meta' => array('meta_key' => 'test_meta_key'), 'test_admin_cols_post_field' => array('post_field' => 'name'), 'test_admin_cols_taxonomy' => array('taxonomy' => 'hello_category')), 'site_filters' => array('test_site_filters_post_meta_key' => array('meta_key' => 'test_meta_key'), 'test_site_filters_post_meta_search' => array('meta_search_key' => 'test_meta_key'), 'test_site_filters_post_meta_exists' => array('meta_exists' => array('test_meta_key')), 'test_site_filters_with_cap' => array('meta_key' => 'test_meta_key', 'cap' => 'have_kittens'), 'test_site_filters_post_meta_query' => array('meta_key' => 'test_meta_key', 'meta_query' => array('compare' => '>=', 'value' => 'B', 'type' => 'CHAR')), 'test_site_filters_post_meta_query_deprecated' => array('meta_key' => 'test_meta_key', 'meta_compare' => '>=', 'meta_value' => 'B', 'meta_type' => 'CHAR'), 'test_site_filters_invalid' => array('meta_query' => array('key' => 'foo', 'value' => 'bar'))), 'archive' => array('orderby' => 'post_title'), 'query_var' => 'hi');
     $this->cpts['hello'] = register_extended_post_type('hello', $this->args['hello']);
     $this->cpts['hello']->add_taxonomy('hello_category');
     $this->cpts['person'] = register_extended_post_type('person', array('has_archive' => 'team', 'show_in_feed' => true, 'site_sortables' => array('test_site_sortables_post_name' => array('post_field' => 'post_name', 'default' => 'asc')), 'admin_cols' => array('test_admin_cols_post_name' => array('post_field' => 'post_name', 'default' => 'asc'), 'test_admin_cols_unsortable' => array('meta_key' => 'test_meta_key', 'sortable' => false), 'test_admin_cols_test_meta_key' => array('meta_key' => 'test_meta_key'), 'test_admin_cols_person_category' => array('taxonomy' => 'person_category'))), array('plural' => 'People'));
     $this->cpts['person']->add_taxonomy('person_category');
     $this->cpts['nice-thing'] = register_extended_post_type('nice-thing', array(), array('slug' => 'Things'));
     $this->cpts['foo'] = register_extended_post_type('foo', array('rewrite' => array('permastruct' => 'foo/%author%/%foo_category%/%foo%'), 'show_in_feed' => true), array('singular' => 'Bar'));
     $this->cpts['foo']->add_taxonomy('foo_category');
     $this->cpts['bar'] = register_extended_post_type('bar', array('public' => false, 'featured_image' => 'Icon'), array('plural' => 'Plural', 'singular' => 'Singular', 'slug' => 'Slug'));
     $this->cpts['baz'] = register_extended_post_type('baz', array('rewrite' => array('permastruct' => 'baz/%postname%'), 'has_archive' => false));
     $this->cpts['post'] = register_extended_post_type('post', array('labels' => array('remove_featured_image' => 'Remove!')));
     $wp_rewrite->flush_rules();
     foreach (array('Alpha', 'Beta', 'Gamma', 'Delta') as $slug) {
         wp_insert_term($slug, 'hello_category');
         wp_insert_term($slug, 'foo_category');
     }
     // Post
     $this->posts['post'][] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'post', 'post_date' => '1984-02-25 00:05:00'));
     // Hello 0
     $this->posts['hello'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'hello', 'post_name' => 'Alpha', 'post_date' => '1984-02-25 00:04:00'));
     add_post_meta($this->posts['hello'][0], 'test_meta_key', 'Delta');
     wp_add_object_terms($this->posts['hello'][0], 'Beta', 'hello_category');
     // Hello 1
     $this->posts['hello'][1] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'hello', 'post_name' => 'Delta', 'post_date' => '1984-02-25 00:03:00'));
     add_post_meta($this->posts['hello'][1], 'test_meta_key', 'Alpha');
     // Hello 2
     $this->posts['hello'][2] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'hello', 'post_name' => 'Beta', 'post_date' => '1984-02-25 00:02:00'));
     add_post_meta($this->posts['hello'][2], 'test_meta_key', 'Beta');
     wp_add_object_terms($this->posts['hello'][2], 'Alpha', 'hello_category');
     // Hello 3
     $this->posts['hello'][3] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'hello', 'post_name' => 'Gamma', 'post_date' => '1984-02-25 00:01:00'));
     wp_add_object_terms($this->posts['hello'][3], 'Gamma', 'hello_category');
     $this->posts['person'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'person', 'post_name' => 'Beta', 'post_date' => '1984-02-25 00:01:00'));
     $this->posts['person'][1] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'person', 'post_name' => 'Alpha', 'post_date' => '1984-02-25 00:02:00'));
     $this->posts['nice-thing'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'nice-thing'));
     $this->posts['foo'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'foo', 'post_author' => 1));
     wp_add_object_terms($this->posts['foo'][0], array('Gamma', 'Delta'), 'foo_category');
     $this->posts['bar'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'bar'));
     $this->posts['baz'][0] = $this->factory->post->create(array('guid' => 'guid', 'post_type' => 'baz'));
 }
 function setUp()
 {
     global $wp_rewrite;
     parent::setUp();
     $wp_rewrite->init();
     $wp_rewrite->set_permalink_structure('/%year%/%monthnum%/%day%/%postname%/');
     $this->args['hello'] = array('site_sortables' => array('test_site_sortables_post_meta' => array('meta_key' => 'test_meta_key'), 'test_site_sortables_post_field' => array('post_field' => 'name'), 'test_site_sortables_taxonomy' => array('taxonomy' => 'hello_category')), 'site_filters' => array('test_site_filters_post_meta_key' => array('meta_key' => 'test_meta_key'), 'test_site_filters_post_meta_search' => array('meta_search_key' => 'test_meta_key'), 'test_site_filters_post_meta_exists' => array('meta_exists' => array('test_meta_key'))));
     $this->cpts['hello'] = register_extended_post_type('hello', $this->args['hello']);
     $this->cpts['hello']->add_taxonomy('hello_category');
     $this->cpts['person'] = register_extended_post_type('person', array('has_archive' => 'team'), array('plural' => 'People'));
     $this->cpts['nice-thing'] = register_extended_post_type('nice-thing', array(), array('slug' => 'Things'));
     $this->cpts['foo'] = register_extended_post_type('foo', array('rewrite' => array('permastruct' => 'foo/%author%/%foo_category%/%foo%')), array('singular' => 'Bar'));
     $this->cpts['foo']->add_taxonomy('foo_category');
     $wp_rewrite->flush_rules();
     foreach (array('Alpha', 'Beta', 'Gamma', 'Delta') as $slug) {
         wp_insert_term($slug, 'hello_category');
         wp_insert_term($slug, 'foo_category');
     }
     // Post
     $this->posts['post'][] = $this->factory->post->create(array('post_type' => 'post', 'post_date' => '1984-02-25 00:05:00'));
     // Hello 0
     $this->posts['hello'][0] = $this->factory->post->create(array('post_type' => 'hello', 'post_name' => 'Alpha', 'post_date' => '1984-02-25 00:04:00'));
     add_post_meta($this->posts['hello'][0], 'test_meta_key', 'Delta');
     wp_add_object_terms($this->posts['hello'][0], 'Beta', 'hello_category');
     // Hello 1
     $this->posts['hello'][1] = $this->factory->post->create(array('post_type' => 'hello', 'post_name' => 'Delta', 'post_date' => '1984-02-25 00:03:00'));
     add_post_meta($this->posts['hello'][1], 'test_meta_key', 'Alpha');
     // Hello 2
     $this->posts['hello'][2] = $this->factory->post->create(array('post_type' => 'hello', 'post_name' => 'Beta', 'post_date' => '1984-02-25 00:02:00'));
     add_post_meta($this->posts['hello'][2], 'test_meta_key', 'Beta');
     wp_add_object_terms($this->posts['hello'][2], 'Alpha', 'hello_category');
     // Hello 3
     $this->posts['hello'][3] = $this->factory->post->create(array('post_type' => 'hello', 'post_name' => 'Gamma', 'post_date' => '1984-02-25 00:01:00'));
     wp_add_object_terms($this->posts['hello'][3], 'Gamma', 'hello_category');
     $this->posts['person'][0] = $this->factory->post->create(array('post_type' => 'person'));
     $this->posts['nice-thing'][0] = $this->factory->post->create(array('post_type' => 'nice-thing'));
     $this->posts['foo'][0] = $this->factory->post->create(array('post_type' => 'foo', 'post_author' => 1));
     wp_add_object_terms($this->posts['foo'][0], array('Gamma', 'Delta'), 'foo_category');
 }
Ejemplo n.º 7
0
 /**
  * Register custom post types and taxonomies
  * 
  * @since  1.0.0
  */
 public function cpts_taxos()
 {
     // sparks (shortcodes)
     $labels = array('menu_name' => __('Spark Core', $this->plugin_slug), 'name' => __('Sparks', $this->plugin_slug), 'singular_name' => __('Spark', $this->plugin_slug), 'all_items' => __('All Sparks', $this->plugin_slug), 'add_new' => __('Add Spark', $this->plugin_slug), 'add_new_item' => __('Add Spark', $this->plugin_slug), 'edit_item' => __('Edit Spark', $this->plugin_slug), 'new_item' => __('New Spark', $this->plugin_slug), 'search_items' => __('Search Sparks', $this->plugin_slug), 'not_found' => __('No shortcodes found', $this->plugin_slug), 'not_found_in_trash' => __('No shortcodes found in Trash', $this->plugin_slug));
     register_extended_post_type('spark', array('label' => __('Spark Core', $this->plugin_slug), 'labels' => $labels, 'supports' => false, 'public' => false, 'show_ui' => true, 'quick_edit' => false, 'menu_icon' => 'dashicons-admin-site', 'menu_position' => 75, 'hierarchical' => false, 'cols' => array('title' => false, 'id' => array('title' => __('#ID', $this->plugin_slug), 'function' => array($this, 'id_column'), 'default' => 'asc'), 'core' => array('title' => __('Core', $this->plugin_slug), 'meta_key' => 'spark-core'), 'variable' => array('title' => __('Variable', $this->plugin_slug), 'meta_key' => 'spark-variable'), 'cache' => array('title' => __('Cache', $this->plugin_slug), 'meta_key' => 'spark-cache', 'function' => array($this, 'cache_column')), 'shortcode' => array('title' => __('Shortcodes', $this->plugin_slug), 'sortable' => false, 'function' => array($this, 'shortcode_column'))), 'filters' => array('m' => false)));
 }
Ejemplo n.º 8
0
 public static function register()
 {
     register_extended_post_type('module', ['has_archive' => false, 'show_ui' => true, 'show_in_menu' => 'edit.php?post_type=page', 'show_in_feed' => false, 'supports' => ['title', 'thumbnail', 'editor'], 'labels' => ['name' => __('Modules', 'intra'), 'singular_name' => __('Module', 'intra'), 'menu_name' => __('Modules', 'intra'), 'name_admin_bar' => __('Module', 'intra'), 'add_new' => __('Create new', 'intra'), 'add_new_item' => __('Create new Module', 'intra'), 'edit_item' => __('Edit Module', 'intra'), 'new_item' => __('New Module', 'intra'), 'view_item' => __('Show Module', 'intra'), 'search_items' => __('Search Module', 'intra'), 'not_found' => __('No Modules found', 'intra'), 'not_found_in_trash' => __('No Modules in trash', 'intra'), 'parent_item_colon' => __('Module parent:', 'intra'), 'all_items' => __('All Modules', 'intra'), 'archives' => __('Module Archive', 'intra'), 'insert_into_item' => __('Add in Module', 'intra'), 'uploaded_to_this_item' => __('Uploaded to Module', 'intra'), 'filter_items_list' => __('Filter Module list', 'intra'), 'items_list_navigation' => __('Navigate list', 'intra'), 'items_list' => __('Module list', 'intra')]], ['singular' => __('Module', 'intra'), 'plural' => __('Modules', 'intra')]);
 }
Ejemplo n.º 9
0
function doc_documents_register_post_types()
{
    register_extended_post_type('document', array('enter_title_here' => 'Document Title', 'admin_cols' => array('published' => array('title' => 'Published', 'meta_key' => 'published_date', 'date_format' => 'd/m/Y'), 'my_connection' => array('title' => 'Owned by', 'connection' => 'departments_to_documents'))));
}
Ejemplo n.º 10
0
 /**
  * @expectedIncorrectUsage register_post_type
  */
 public function testInvalidPostTypeTriggersError()
 {
     $max_length = 20;
     $name = str_repeat('a', $max_length + 1);
     $result = register_post_type($name);
     $this->assertWPError($result);
     try {
         register_extended_post_type($name);
         $this->fail('register_extended_post_type() should trigger an error when registering a post type which causes an error');
     } catch (PHPUnit_Framework_Error $e) {
         $this->assertContains("{$max_length}", $e->getMessage());
     }
     _unregister_post_type($name);
 }
Ejemplo n.º 11
0
<?php

/**
 * Register post types using Extended CPTs (in mu-plugins)
 */
add_action('init', function () {
    register_extended_post_type('video', array('has_archive' => false, 'menu_icon' => 'dashicons-editor-video', 'supports' => array('title', 'editor', 'thumbnail', 'page-attributes'), 'admin_cols' => array('featured_image' => array('title' => __('Thumbnail', 'rt'), 'featured_image' => 'thumbnail'), 'title', 'published' => array('title' => __('Published', 'rt'), 'meta_key' => 'published_date')), 'admin_filters' => array()));
    register_extended_post_type('question', array('has_archive' => false, 'menu_icon' => 'dashicons-editor-help', 'admin_cols' => array('title', 'published' => array('title' => __('Published', 'rt'), 'meta_key' => 'published_date')), 'admin_filters' => array()));
    register_extended_post_type('submission', array('menu_icon' => 'dashicons-format-status', 'supports' => array('title', 'editor', 'author', 'thumbnail', 'comments'), 'labels' => array('featured_image' => __('Thumbnail', 'rt'), 'set_featured_image' => __('Choose Thumbnail', 'rt'), 'remove_featured_image' => __('Remove Thumbnail', 'rt'), 'use_featured_image' => __('Use as Thumbnail', 'rt')), 'admin_cols' => array('title', 'author', 'submission_type' => array('taxonomy' => 'submission_type'), 'theme' => array('taxonomy' => 'theme'), 'language' => array('taxonomy' => 'language'), 'country' => array('taxonomy' => 'country'), 'published' => array('title' => __('Published', 'rt'), 'meta_key' => 'published_date')), 'admin_filters' => array('submission_type' => array('taxonomy' => 'submission_type'), 'theme' => array('taxonomy' => 'theme'), 'language' => array('taxonomy' => 'language'), 'country' => array('taxonomy' => 'country'))));
    $args = array('hierarchical' => false);
    register_extended_taxonomy('submission_type', 'submission', $args);
    register_extended_taxonomy('theme', 'submission', $args);
    register_extended_taxonomy('language', 'submission', $args);
    register_extended_taxonomy('country', 'submission', $args, array('plural' => 'Countries', 'singular' => 'Country'));
});
/**
 * Remove default taxonomy metaboxes from submission post type
 */
add_action('admin_menu', function () {
    remove_meta_box('themediv', 'submission', 'side');
    remove_meta_box('languagediv', 'submission', 'side');
    remove_meta_box('countrydiv', 'submission', 'side');
});
/**
 * Add posts-to-posts connection types
 */
add_action('p2p_init', function () {
    p2p_register_connection_type(array('name' => 'video_to_question', 'from' => 'video', 'to' => 'question', 'cardinality' => 'one-to-one', 'admin_box' => array('context' => 'advanced'), 'title' => array('from' => __('Question', 'rt'), 'to' => __('Video', 'rt')), 'from_labels' => array('create' => __('Choose Video', 'rt')), 'to_labels' => array('create' => __('Choose Question', 'rt'))));
    p2p_register_connection_type(array('name' => 'submission_to_question', 'from' => 'submission', 'to' => 'question', 'cardinality' => 'one-to-one', 'admin_box' => array('context' => 'advanced'), 'title' => array('from' => __('Question', 'rt'), 'to' => __('Submission', 'rt')), 'from_labels' => array('create' => __('Choose Submission', 'rt')), 'to_labels' => array('create' => __('Choose Question', 'rt'))));
});