WordPress at a glance
function is not described

WP_REST_Settings_Controller::get_registered_options() protected WP 4.7.0

Retrieves all of the registered options for the Settings API.

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

No Hooks.

Return

Array. Array of registered options.

Usage

// protected - for code of main (parent) or child class
$result = $this->get_registered_options();

Changelog

Since 4.7.0 Introduced.

Code of WP_REST_Settings_Controller::get_registered_options() WP 5.5.1

<?php
protected function get_registered_options() {
	$rest_options = array();

	foreach ( get_registered_settings() as $name => $args ) {
		if ( empty( $args['show_in_rest'] ) ) {
			continue;
		}

		$rest_args = array();

		if ( is_array( $args['show_in_rest'] ) ) {
			$rest_args = $args['show_in_rest'];
		}

		$defaults = array(
			'name'   => ! empty( $rest_args['name'] ) ? $rest_args['name'] : $name,
			'schema' => array(),
		);

		$rest_args = array_merge( $defaults, $rest_args );

		$default_schema = array(
			'type'        => empty( $args['type'] ) ? null : $args['type'],
			'description' => empty( $args['description'] ) ? '' : $args['description'],
			'default'     => isset( $args['default'] ) ? $args['default'] : null,
		);

		$rest_args['schema']      = array_merge( $default_schema, $rest_args['schema'] );
		$rest_args['option_name'] = $name;

		// Skip over settings that don't have a defined type in the schema.
		if ( empty( $rest_args['schema']['type'] ) ) {
			continue;
		}

		/*
		 * Allow the supported types for settings, as we don't want invalid types
		 * to be updated with arbitrary values that we can't do decent sanitizing for.
		 */
		if ( ! in_array( $rest_args['schema']['type'], array( 'number', 'integer', 'string', 'boolean', 'array', 'object' ), true ) ) {
			continue;
		}

		$rest_args['schema'] = $this->set_additional_properties_to_false( $rest_args['schema'] );

		$rest_options[ $rest_args['name'] ] = $rest_args;
	}

	return $rest_options;
}