Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_CLI_REST_Command::get_context_fields( string $context )
Get a list of fields present in a given context
Description Description
Parameters Parameters
- $context
-
(Required) Scope under which the request is made. Determines fields present in response.
Return Return
(array)
Source Source
File: includes/cli/class-wc-cli-rest-command.php
private function get_context_fields( $context ) { $fields = array(); foreach ( $this->schema['properties'] as $key => $args ) { if ( empty( $args['context'] ) || in_array( $context, $args['context'], true ) ) { $fields[] = $key; } } return $fields; }