-
Notifications
You must be signed in to change notification settings - Fork 0
Taxonomy
rogertm edited this page Oct 11, 2023
·
7 revisions
Para crear taxonomías debemos crear una nueva clase extendida de WASP\Taxonomy\Taxonomy.
<?php
use WASP\Taxonomy\Taxonomy;
class My_Plugin_Custom_Taxonomy extends Taxonomy
{
function __construct()
{
parent::__construct();
$this->taxonomy = 'my-custom-taxonomy';
$this->object_type = 'post';
$this->labels = array( ... );
$this->args = array( ... );
}
}
new My_Plugin_Custom_Taxonomy;La propiedad labels hace referencia a $args['labels'] en la función register_taxonomy(), args al resto de los argumentos pasados a esta función.
- Function
register_taxonomy().