-
Notifications
You must be signed in to change notification settings - Fork 0
Taxonomy
rogertm edited this page Sep 13, 2023
·
7 revisions
Para crear taxonomías debemos crear una nueva clase extendida de WASP_Taxonomy
<?php
class My_Plugin_Custom_Taxonomy extends WASP_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.
Referencia register_taxonomy().