From 7389596a6d62739bc3af0f93d27ba442b55a36e3 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 20 Sep 2019 13:04:50 +0000 Subject: [PATCH] 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 --- src/wp-includes/post.php | 5 +++-- src/wp-includes/taxonomy.php | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 56b7317c6f..b40e94d8ce 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -1313,10 +1313,11 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' ) * type will be placed as a sub-menu of that. * Default is value of $show_ui. * @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 * 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_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, diff --git a/src/wp-includes/taxonomy.php b/src/wp-includes/taxonomy.php index 04c2b8bfce..3231285b1a 100644 --- a/src/wp-includes/taxonomy.php +++ b/src/wp-includes/taxonomy.php @@ -363,7 +363,8 @@ function is_taxonomy_hierarchical( $taxonomy ) { * (default true). * @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). - * @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_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,