Pink-Crab / Perique-Registerables

The Registerables module for the PinkCrab framework.
MIT License
3 stars 0 forks source link

Taxonomy Registration issue with capabilities #62

Closed gin0115 closed 2 years ago

gin0115 commented 2 years ago

If you do not define capabilities, they will take

 'capabilities'          => $taxonomy->capabilities ?? array(
   'manage_terms' => "manage_ {$taxonomy->slug}",
   'edit_terms'   => "edit_ {$taxonomy->slug}",
   'delete_terms' => "delete {$taxonomy->slug}",
   'assign_terms' => "assign_ {$taxonomy->slug}",
),

But this means we can not manage the tax, this should be removed and replaced with

// Add capabilities if defined.
if ( $taxonomy->capabilities ) {
    $args['capabilities'] = $taxonomy->capabilities;
}