mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-09-19 15:30:26 +00:00
Docs: Document the globals used in some REST API methods.
See #53399. git-svn-id: https://develop.svn.wordpress.org/trunk@51278 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -504,11 +504,14 @@ abstract class WP_REST_Controller {
|
||||
*
|
||||
* @since 4.7.0
|
||||
*
|
||||
* @global array $wp_rest_additional_fields Holds registered fields, organized by object type.
|
||||
*
|
||||
* @param string $object_type Optional. The object type.
|
||||
* @return array Registered additional fields (if any), empty array if none or if the object type could
|
||||
* not be inferred.
|
||||
* @return array Registered additional fields (if any), empty array if none or if the object type
|
||||
* could not be inferred.
|
||||
*/
|
||||
protected function get_additional_fields( $object_type = null ) {
|
||||
global $wp_rest_additional_fields;
|
||||
|
||||
if ( ! $object_type ) {
|
||||
$object_type = $this->get_object_type();
|
||||
@@ -518,8 +521,6 @@ abstract class WP_REST_Controller {
|
||||
return array();
|
||||
}
|
||||
|
||||
global $wp_rest_additional_fields;
|
||||
|
||||
if ( ! $wp_rest_additional_fields || ! isset( $wp_rest_additional_fields[ $object_type ] ) ) {
|
||||
return array();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user