<?php

namespace Blazemedia\Blackhole\CustomPostTypes;

class Blackhole {

    static function init() {

        // Add the custom columns to the posts post type:
        add_filter( 'init',    [ get_called_class(), 'add_post_type'] );
    }

    /**
     * registra il post-type per le tabelle
     *
     * @return void
     */
    static function add_post_type() {

        register_post_type('blackhole', [

            'public'              => false,
            'show_ui'             => true,
            'show_in_menu'        => false,
            'publicly_queryable'  => false,
            'capability_type'     => 'post',
            'exclude_from_search' => true,
            'can_export'          => false,
            'hierarchical'        => false,
            'rewrite'             => false,
            'has_archive'         => false,
            'supports'            => [ 'title' ],
            //'show_in_nav_menus' => false,
            'taxonomies'          => [ 'post_tag' ],


            'menu_position' => 81,

            'labels' => [
                'name' => 'Blackhole',
                'singular_name' => 'Blackhole',
                'add_new' => 'Aggiungi nuovo',
                'add_new_item' => 'Aggiungi nuovo in Blackhole',
                'edit' => 'Modifica',
                'edit_item' => 'Modifica in Blackhole',
                'new_item' => 'Nuovo in Blackhole',
                'view' => 'Vedi',
                'view_item' => 'Vedi Blackhole',
                'search_items' => 'Cerca Blackhole',
                'not_found' => 'Nessun Blackhole trovato',
                'not_found_in_trash' => 'Nessuna Blackhole trovato nel cestino'
            ]
        ]);

    }


}
