WordPress at Your Fingertips
function is not described

WC_CLI_REST_Command::get_context_fields() private WC 1.0

Get a list of fields present in a given context

{} It's a method of the class: WC_CLI_REST_Command{}

No Hooks.

Return

Array.

Usage

// private - for code of main (parent) class only
$result = $this->get_context_fields( $context );
$context(string) (required)
Scope under which the request is made. Determines fields present in response.

Code of WC_CLI_REST_Command::get_context_fields() WC 5.9.0

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;
}