src/CustomTaxonomyBuilder.php
private function registerTaxonomy($tax, $cpt_singular, $cpt_plural)
    {
        $singular_name = $this->getSingularTaxName($tax);
        $plural_name = $this->getPluralTaxName($tax);
        $hierarchical = isset($tax['hierarchical']) ? $tax['hierarchical'] : true;
        $default_terms = isset($tax['default_terms']) ? $tax['default_terms'] : [];
        $builder = new Cpt;

        /* Set up the arguments for the priority taxonomy. */
        $args = [
            'public'            => true,
            'show_ui'           => true,
            'show_in_nav_menus' => true,
            'show_admin_column' => true,
            'hierarchical'      => $hierarchical,
            'query_var'         => $singular_name,
            'capabilities' => $this->getCapabilities($cpt_singular, $cpt_plural),
            'labels' => $this->getLabels($tax)
        ];

        // Register the taxonomy
        register_taxonomy($singular_name, [$cpt_singular], $args);

        // add default terms
        $this->taxonomyAddDefaultTerms($singular_name, $default_terms);
    }
private function registerTaxonomy($tax, $cpt_singular, $cpt_plural)
    {
        $singular_name = $this->getSingularTaxName($tax);
        $plural_name = $this->getPluralTaxName($tax);
        $hierarchical = isset($tax['hierarchical']) ? $tax['hierarchical'] : true;
        $default_terms = isset($tax['default_terms']) ? $tax['default_terms'] : [];
        $builder = new Cpt;

        /* Set up the arguments for the priority taxonomy. */
        $args = [
            'public'            => true,
            'show_ui'           => true,
            'show_in_nav_menus' => true,
            'show_admin_column' => true,
            'hierarchical'      => $hierarchical,
            'query_var'         => $singular_name,
            'capabilities' => $this->getCapabilities($cpt_singular, $cpt_plural),
            'labels' => $this->getLabels($tax)
        ];

        // Register the taxonomy
        register_taxonomy($singular_name, [$cpt_singular], $args);

        // add default terms
        $this->taxonomyAddDefaultTerms($singular_name, $default_terms);
    }
private function registerTaxonomy ( $ tax , $ cpt_singular , $ cpt_plural ) { $ singular_name = $ this -> getSingularTaxName ( $ tax ) ; $ plural_name = $ this -> getPluralTaxName ( $ tax ) ; $ hierarchical = isset ( $ tax [ 'hierarchical' ] ) ? $ tax [ 'hierarchical' ] : true ; $ default_terms = isset ( $ tax [ 'default_terms' ] ) ? $ tax [ 'default_terms' ] : [ ] ; $ builder = new Cpt ; /* Set up the arguments for the priority taxonomy. */ $ args = [ 'public' => true , 'show_ui' => true , 'show_in_nav_menus' => true , 'show_admin_column' => true , 'hierarchical' => $ hierarchical , 'query_var' => $ singular_name , 'capabilities' => $ this -> getCapabilities ( $ cpt_singular , $ cpt_plural ) , 'labels' => $ this -> getLabels ( $ tax ) ] ; // Register the taxonomy register_taxonomy ( $ singular_name , [ $ cpt_singular ] , $ args ) ; // add default terms $ this -> taxonomyAddDefaultTerms ( $ singular_name , $ default_terms ) ; }
Register taxonomies for the plugin.\
Register taxonomies for the plugin . \