Create taxonomy with meta term using the WP Rest Api

I think you need an update_callback in register_rest_field(). Please note that I haven’t tested this. add_action( ‘rest_api_init’, ‘slug_register_meta’ ); function slug_register_meta() { register_rest_field( ‘place’, ‘meta’, array( ‘get_callback’ => ‘slug_get_meta’, ‘update_callback’ => ‘slug_update_meta’, ‘schema’ => null, ) ); } function slug_get_meta( $object, $field_name, $request ) { return get_term_meta( $object[ ‘id’ ] ); } function slug_update_meta($value, $object, … Read more

How to return a list of custom taxonomy terms via the Gutenberg getEntityRecords method

The getEntityRecords() method uses the REST API, so make sure the taxonomy is enabled for the REST API. You can enable it via the show_in_rest parameter when registering the taxonomy using register_taxonomy(). With getEntityRecords(), if you set per_page to -1, it will actually be changed to 100, which as you’ve figured it out, is the … Read more

Add/overwrite a parameter on an existing post type/taxonomy

you could modify the global variable $wp_post_types or in the case of taxonomies, $wp_taxonomies for example, this will change the menu name and all the labels for the default Posts to Bacon: function change_post_menu_label() { global $menu; global $submenu; $menu[5][0] = ‘Bacon’; $submenu[‘edit.php’][5][0] = ‘Bacon’; $submenu[‘edit.php’][10][0] = ‘Add Bacon’; $submenu[‘edit.php’][16][0] = ‘Bacon Tags’; echo ”; … Read more

Create an archive page for custom taxonomies

It looks like your issue is the name of your taxonomy has a capital letter, the first argument of register_taxonomy is to be all lowercase, no spaces as the documentation for the register_taxonomy function mentions here. Change your code to the following and your taxonomy-gallery.php template will work correctly. register_taxonomy( ‘gallery’, array( ‘photo’ ), array( … Read more