Define Options

Options for a Taxonomy are defined in the options() method and must return an array of valid WordPress taxonomy optionsarrow-up-right.

By default, an empty array is returned.

See register_taxonomy()arrow-up-right for a full list of supported options.

use PostTypes\Taxonomy;

class Genres extends Taxonomy
{
    //...

    /**
     * Returns the options for the Genres taxonomy.
     *
     * @return array
     */
    public function options(): array
    {
        return [
            'public'       => true,
            'hierarchical' => true,
        ];
    }
}

Last updated