I don't know why the custom taxnonomy for a custom post type not showing up in admin column (it is disappeared).

[![enter image description here](https://i.stack.imgur.com/q3CVO.png)](https://i.stack.imgur.com/q3CVO.png)

The following is the code that **always worked**:

```
class SEW_SERVICE
{

    function __construct() {
        add_action( 'init',  array($this, 'init') );
    }

    function init() {
        $this->taxonomies();
        $this->custom_posts();
    }

    function taxonomies() {
        $labels = array(
            'name' => __( 'Categorie Servizi', SEWCL_TEXT_DOMAIN ),
            'singular_name' => __( 'Categoria Servizio', SEWCL_TEXT_DOMAIN ),
            'search_items' => __( 'Search Menu Sections', SEWCL_TEXT_DOMAIN ),
            'all_items' => __( 'Tutte le categorie', SEWCL_TEXT_DOMAIN ),
            'parent_item' => __( 'Categoria', SEWCL_TEXT_DOMAIN ),
            'parent_item_colon' => __( 'Categoria Servizio:', SEWCL_TEXT_DOMAIN ),
            'edit_item' => __( 'Modifica Categoria Servizio', SEWCL_TEXT_DOMAIN ),
            'update_item' => __( 'Aggiorna Categoria Servizio', SEWCL_TEXT_DOMAIN ),
            'add_new_item' => __( 'Aggiungi Nuova Categoria', SEWCL_TEXT_DOMAIN ),
            'new_item_name' => __( 'Categoria Servizio', SEWCL_TEXT_DOMAIN )
        );

        $args = array(
            'hierarchical' => true, // Settare a false se invece di categorie si vogliono creare tag
            'labels' => $labels,
            'show_ui' => true,
            'show_admin_column' => true,
            'query_var' => true,
            'rewrite' => array( 'slug' => 'sew-servizi' ),
        );

        register_taxonomy( 'sew-categorie-servizi', null, $args);
    }

    function custom_posts() {
        register_post_type( 'sew-servizio',
            array(
                'rewrite' => array( 'slug' => 'sew-servizio' ),
                'labels' => array(
                    'name' => __('Lista Servizi', SEWCL_TEXT_DOMAIN),
                    'singular_name' => __('Servizo', SEWCL_TEXT_DOMAIN),
                    'add_new' => __('Aggiungi Servizo', SEWCL_TEXT_DOMAIN),
                    'add_new_item' => __('Aggiungi Nuovo Servizo', SEWCL_TEXT_DOMAIN),
                    'edit' => __('Modifica', SEWCL_TEXT_DOMAIN),
                    'edit_item' => __('Modifica Servizo', SEWCL_TEXT_DOMAIN),
                    'new_item' => __('Nuovo Servizo', SEWCL_TEXT_DOMAIN),
                    'view' => __('Visualizza', SEWCL_TEXT_DOMAIN),
                    'view_item' => __('Visualizza Servizo', SEWCL_TEXT_DOMAIN),
                    'search_items' => __('Cerca Servizo', SEWCL_TEXT_DOMAIN),
                    'not_found' => __('Nessuna servizio presente', SEWCL_TEXT_DOMAIN),
                    'not_found_in_trash' => __('Nessun servizio presente nel cestino', SEWCL_TEXT_DOMAIN),
                    'parent' => __('Parent Movie Review', SEWCL_TEXT_DOMAIN)
                ),
                'public' => true,
                'menu_position' => 15,
                'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes'  ),
                'taxonomies' => array( 'sew-categorie-servizi' ),
                'menu_icon' => 'dashicons-list-view',
                'has_archive' => true,
                'exclude_from_search' => false,
                'show_in_nav_menus' => false,
            )
        );
    }
}

```

as described here:

<https://codex.wordpress.org/Function_Reference/register_taxonomy>

the second parameter is set to null because I associate the taxonomy to the custom post type when I use **register\_post\_type()**

I don't know why the code has stop to work. I use this code from 3 years.

**The taxonomy exists. If I try to access it via URL, it works:**

/wp-admin/edit-tags.php?taxonomy=sew-categorie-servizi&post\_type=sew-servizio

[![enter image description here](https://i.stack.imgur.com/Tooti.png)](https://i.stack.imgur.com/Tooti.png)

Seems that the taxonomy is not associated to the custom post. In fact, in the editing screen of a post, it is not even visible anymore the box to associate the post with the taxonomy

Any ideas?

UPDATE
------

I also tried to put everything in chronological order but it doesn't work anyway

```
function custom_posts() {
    register_post_type( 'sew-servizio',
        array(
            'rewrite' => array( 'slug' => 'sew-servizio' ),
            'labels' => array(
                'name' => __('Lista Servizi', SEWCL_TEXT_DOMAIN),
                'singular_name' => __('Servizo', SEWCL_TEXT_DOMAIN),
                'add_new' => __('Aggiungi Servizo', SEWCL_TEXT_DOMAIN),
                'add_new_item' => __('Aggiungi Nuovo Servizo', SEWCL_TEXT_DOMAIN),
                'edit' => __('Modifica', SEWCL_TEXT_DOMAIN),
                'edit_item' => __('Modifica Servizo', SEWCL_TEXT_DOMAIN),
                'new_item' => __('Nuovo Servizo', SEWCL_TEXT_DOMAIN),
                'view' => __('Visualizza', SEWCL_TEXT_DOMAIN),
                'view_item' => __('Visualizza Servizo', SEWCL_TEXT_DOMAIN),
                'search_items' => __('Cerca Servizo', SEWCL_TEXT_DOMAIN),
                'not_found' => __('Nessuna servizio presente', SEWCL_TEXT_DOMAIN),
                'not_found_in_trash' => __('Nessun servizio presente nel cestino', SEWCL_TEXT_DOMAIN),
                'parent' => __('Parent Movie Review', SEWCL_TEXT_DOMAIN)
            ),
            'public' => true,
            'menu_position' => 15,
            'supports' => array( 'title', 'editor', 'thumbnail', 'custom-fields', 'page-attributes'  ),
            //'taxonomies' => array( 'sew-categorie-servizi' ),
            'menu_icon' => 'dashicons-list-view',
            'has_archive' => true,
            'exclude_from_search' => false,
            'show_in_nav_menus' => false,
            /*
            'capabilities' => array(
                'edit_post' => 'update_core',
                'delete_post' => 'update_core',
                'edit_posts' => 'update_core',
                'edit_others_posts' => 'update_core',
                'publish_posts' => 'update_core',
                'read_private_posts' => 'update_core'
            ),
            */
        )
    );

    $labels = array(
        'name' => __( 'Categorie Servizi', SEWCL_TEXT_DOMAIN ),
        'singular_name' => __( 'Categoria Servizio', SEWCL_TEXT_DOMAIN ),
        'search_items' => __( 'Search Menu Sections', SEWCL_TEXT_DOMAIN ),
        'all_items' => __( 'Tutte le categorie', SEWCL_TEXT_DOMAIN ),
        'parent_item' => __( 'Categoria', SEWCL_TEXT_DOMAIN ),
        'parent_item_colon' => __( 'Categoria Servizio:', SEWCL_TEXT_DOMAIN ),
        'edit_item' => __( 'Modifica Categoria Servizio', SEWCL_TEXT_DOMAIN ),
        'update_item' => __( 'Aggiorna Categoria Servizio', SEWCL_TEXT_DOMAIN ),
        'add_new_item' => __( 'Aggiungi Nuova Categoria', SEWCL_TEXT_DOMAIN ),
        'new_item_name' => __( 'Categoria Servizio', SEWCL_TEXT_DOMAIN )
    );

    $args = array(
        'hierarchical' => true, // Settare a false se invece di categorie si vogliono creare tag
        'labels' => $labels,
        'show_ui' => true,
        'show_admin_column' => true,
        'query_var' => true,
        'rewrite' => array( 'slug' => 'sew-servizi' ), // Url /sew-servizi/nome-servizio
    );

    register_taxonomy( 'sew-categorie-servizi', array('sew-servizio'), $args);    
}

```

SOLVED
------

add\_action( 'init', array($this, 'init'), PHP\_MAX\_INT );