首页 WordPress函数大全 rest_is_field_included()

rest_is_field_included()

2020-05-02 / 2255阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

rest_is_field_included( string $field, array $fields )

给定要包含在响应中的字段数组,其中一些字段可能是nested.fields,确定是否应将提供的字段包含在响应主体中。

描述

如果传入父字段,则该父字段中任何嵌套字段的存在都会导致该方法返回true。例如,如果提供title,title.raw或title.rendered中的任何一个,则“ title”将返回true。

参数

$field

(string)
(Required)
A field to test for inclusion in the response body.

$fields

(array)
(Required)
An array of string fields supported by the endpoint.

返回

(bool) Whether to include the field or not.

大家谈论
    我的见解