Uses
Uses | Description |
---|---|
wp-includes/rest-api/endpoints/class-wp-rest-controller.php: WP_REST_Controller::get_object_type() | Retrieves the object type this controller is responsible for managing. |
Retrieves all of the registered additional fields for a given object-type.
(string) (Optional) The object type.
Default value: null
(array) Registered additional fields (if any), empty array if none or if the object type could not be inferred.
File: wp-includes/rest-api/endpoints/class-wp-rest-controller.php
protected function get_additional_fields( $object_type = null ) { if ( ! $object_type ) { $object_type = $this->get_object_type(); } if ( ! $object_type ) { return array(); } global $wp_rest_additional_fields; if ( ! $wp_rest_additional_fields || ! isset( $wp_rest_additional_fields[ $object_type ] ) ) { return array(); } return $wp_rest_additional_fields[ $object_type ]; }
Version | Description |
---|---|
4.7.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_controller/get_additional_fields