rest_is_field_included


rest_is_field_included ( $field, $fields )

Parameters:
  • (string) field A field to test for inclusion in the response body.
  • (array) fields An array of string fields supported by the endpoint.
Returns:
  • (bool) Whether to include the field or not.
Defined at:

Description

Given an array of fields to include in a response, some of which may be `nested.fields`, determine whether the provided field should be included in the response body.If a parent field is passed in, the presence of any nested field within that parent will cause the method to return `true`. For example "title" will return true if any of `title`, `title.raw` or `title.rendered` is provided.

Related Functions

rest_is_ip_address, rest_api_loaded, rest_is_integer, tinymce_include, rest_stabilize_value

Top Google Results

User discussions

wpseek mobile