尝试使用rest_api_allowed_public_metadata
筛选以将facebook
自定义字段。然后,它将出现在响应中:
add_filter( \'rest_api_allowed_public_metadata\', \'jeherve_allow_fb_metadata\' );
function jeherve_allow_fb_metadata() {
// only run for REST API requests
if ( ! defined( \'REST_API_REQUEST\' ) || ! REST_API_REQUEST )
return $allowed_meta_keys;
$allowed_meta_keys[] = \'facebook\';
return $allowed_meta_keys;
}