-
Notifications
You must be signed in to change notification settings - Fork 0
Term Meta
rogertm edited this page Oct 11, 2023
·
10 revisions
Para agregar custom fields a las taxonomías debemos crear una clase hija de WASP\Taxonomy\Term_Meta.
<?php
use WASP\Taxonomy\Term_Meta;
class My_Plugin_Term_Meta extends Term_Meta
{
function __construct()
{
parent::__construct();
$this->taxonomy = 'my-custom-taxonomy-slug';
}
function fields()
{
$fields = array(
'field_name' => array(
'label' => __( 'Title', 'text-domain' ),
'meta' => 'field_name'
),
/** more fields here */
);
return $fields;
}
}
new My_Plugin_Term_Meta;