Docs: Add missing REST API-related args to `register_post_type()` and `register_taxonomy()`.

These functions now accept the `show_in_rest`, `rest_base`, and `rest_controller_class` args.

Merges [39462] to the 4.7 branch.

Props ketuchetan, rahulsprajapati.
Fixes #39023.



git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39463 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Gary Pendergast 2016-12-03 04:49:37 +00:00
parent aed692cddd
commit 0970fc22e1
2 changed files with 95 additions and 85 deletions

View File

@ -985,6 +985,8 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* @since 4.4.0 The `show_ui` argument is now enforced on the post type listing
* screen and post editing screen.
* @since 4.6.0 Post type object returned is now an instance of WP_Post_Type.
* @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'
* arguments to register the post type in REST API.
*
* @global array $wp_post_types List of post types.
*
@ -1029,6 +1031,9 @@ function get_post_types( $args = array(), $output = 'names', $operator = 'and' )
* Default is value $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 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,
* $show_in_menu must be true. Default null (at the bottom).
* @type string $menu_icon The url to the icon to be used for this menu. Pass a base64-encoded

View File

@ -294,6 +294,8 @@ function is_taxonomy_hierarchical($taxonomy) {
* @since 4.4.0 The `show_ui` argument is now enforced on the term editing screen.
* @since 4.4.0 The `public` argument now controls whether the taxonomy can be queried on the front end.
* @since 4.5.0 Introduced `publicly_queryable` argument.
* @since 4.7.0 Introduced `show_in_rest`, 'rest_base' and 'rest_controller_class'
* arguments to register the Taxonomy in REST API.
*
* @global array $wp_taxonomies Registered taxonomies.
*
@ -323,6 +325,9 @@ 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 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,
* the default is inherited from `$show_ui` (default true).
* @type bool $show_in_quick_edit Whether to show the taxonomy in the quick/bulk edit panel. It not set,