Docs: Clarify that `$show_in_rest` parameter of `register_post_type()` and `register_taxonomy()` should be enabled for the post type or taxonomy to be available in the block editor.

Props ramon-fincken.
Fixes #48084.

git-svn-id: https://develop.svn.wordpress.org/trunk@46196 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2019-09-20 13:04:50 +00:00
parent f326f7ebfb
commit 7389596a6d
2 changed files with 5 additions and 3 deletions

View File

@ -1313,10 +1313,11 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* type will be placed as a sub-menu of that. * type will be placed as a sub-menu of that.
* Default is value of $show_ui. * Default is value of $show_ui.
* @type bool $show_in_nav_menus Makes this post type available for selection in navigation menus. * @type bool $show_in_nav_menus Makes this post type available for selection in navigation menus.
* Default is value $public. * Default is value of $public.
* @type bool $show_in_admin_bar Makes this post type available via the admin bar. Default is value * @type bool $show_in_admin_bar Makes this post type available via the admin bar. Default is value
* of $show_in_menu. * of $show_in_menu.
* @type bool $show_in_rest Whether to add the post type route in the REST API 'wp/v2' namespace. * @type bool $show_in_rest Whether to include the post type in the REST API. Set this to true
* for the post type to be available in the block editor.
* @type string $rest_base To change the base url of REST API route. Default is $post_type. * @type string $rest_base To change the base url of REST API route. Default is $post_type.
* @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Posts_Controller'. * @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Posts_Controller'.
* @type int $menu_position The position in the menu order the post type should appear. To work, * @type int $menu_position The position in the menu order the post type should appear. To work,

View File

@ -363,7 +363,8 @@ function is_taxonomy_hierarchical( $taxonomy ) {
* (default true). * (default true).
* @type bool $show_in_nav_menus Makes this taxonomy available for selection in navigation menus. If not * @type bool $show_in_nav_menus Makes this taxonomy available for selection in navigation menus. If not
* set, the default is inherited from `$public` (default true). * set, the default is inherited from `$public` (default true).
* @type bool $show_in_rest Whether to include the taxonomy in the REST API. * @type bool $show_in_rest Whether to include the taxonomy in the REST API. Set this to true
* for the taxonomy to be available in the block editor.
* @type string $rest_base To change the base url of REST API route. Default is $taxonomy. * @type string $rest_base To change the base url of REST API route. Default is $taxonomy.
* @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Terms_Controller'. * @type string $rest_controller_class REST API Controller class name. Default is 'WP_REST_Terms_Controller'.
* @type bool $show_tagcloud Whether to list the taxonomy in the Tag Cloud Widget controls. If not set, * @type bool $show_tagcloud Whether to list the taxonomy in the Tag Cloud Widget controls. If not set,