View Taxonomy on the edit page

Asked

Viewed 16 times

0

Hello. I don’t know what happened that I can’t do to taxonomy appear on the posts editing page. I don’t know what’s missing from the code, see:

<?php
function registraIdiomas(){
   register_taxonomy(
       'idioma',
       'post',
       array(
           'label' => __('Idiomas'),
           'rewrite' => array('slug' => 'idioma'),
           'hierarchical' => true
       )
   );
}
add_action('init', 'registraIdiomas');

I don’t know why, the code above shows the category Languages in the Wordpress menu at Posts > Languages, but does not stop at posting options. inserir a descrição da imagem aqui

Does anyone know how I can fix this?

1 answer

0

Need to insert to support show_in_rest

<?php
function registraIdiomas(){
   register_taxonomy(
       'idioma',
       'post',
       array(
           'label' => __('Idiomas'),
           'rewrite' => array('slug' => 'idioma'),
           'hierarchical' => true,
           'show_in_rest' => true, // falta isso!!!
       )
   );
}
add_action('init', 'registraIdiomas');

Browser other questions tagged

You are not signed in. Login or sign up in order to post.