Parsed: 123475
<?php /** * REST API functions. * * @package WordPress * @subpackage REST_API * @since 4.4.0 */ /** * Version number for our API. * * @var string */ define( 'REST_API_VERSION', '2.0' ); /* function register_rest_route() – Registers a REST API route. */ /* function register_rest_field() – Registers a new field on an existing WordPress object type. */ /* function rest_api_init() – Registers rewrite rules for the API. */ /* function rest_api_register_rewrites() – Adds REST rewrite rules. */ /* function rest_api_default_filters() – Registers the default REST API filters. */ /* function create_initial_rest_routes() – Registers default REST API routes. */ /* function rest_api_loaded() – Loads the REST API. */ /* function rest_get_url_prefix() – Retrieves the URL prefix for any API resource. */ /* function get_rest_url() – Retrieves the URL to a REST endpoint on a site. */ /* function rest_url() – Retrieves the URL to a REST endpoint. */ /* function rest_do_request() – Do a REST request. */ /* function rest_get_server() – Retrieves the current REST server instance. */ /* function rest_ensure_request() – Ensures request arguments are a request object (for consistency). */ /* function rest_ensure_response() – Ensures a REST response is a response object (for consistency). */ /* function rest_handle_deprecated_function() – Handles _deprecated_function() errors. */ /* function rest_handle_deprecated_argument() – Handles _deprecated_argument() errors. */ /* function rest_handle_doing_it_wrong() – Handles _doing_it_wrong errors. */ /* function rest_send_cors_headers() – Sends Cross-Origin Resource Sharing headers with API requests. */ /* function rest_handle_options_request() – Handles OPTIONS requests for the server. */ /* function rest_send_allow_header() – Sends the "Allow" header to state all methods that can be sent to the current route. */ /* function _rest_array_intersect_key_recursive() – Recursively computes the intersection of arrays using keys for comparison. */ /* function rest_filter_response_fields() – Filter the API response to include only a white-listed set of response object fields. */ /* function rest_is_field_included() – Given an array of fields to include in a response, some of which may be `nested.fields`, determine whether the provided field should be included in the response body. */ /* function rest_output_rsd() – Adds the REST API URL to the WP RSD endpoint. */ /* function rest_output_link_wp_head() – Outputs the REST API link tag into page header. */ /* function rest_output_link_header() – Sends a Link header for the REST API. */ /* function rest_cookie_check_errors() – Checks for errors when using cookie-based authentication. */ /* function rest_cookie_collect_status() – Collects cookie authentication status. */ /* function rest_application_password_collect_status() – Collects the status of authenticating with an application password. */ /* function rest_get_authenticated_app_password() – Gets the Application Password used for authenticating the request. */ /* function rest_application_password_check_errors() – Checks for errors when using application password-based authentication. */ /* function rest_add_application_passwords_to_index() – Adds Application Passwords info to the REST API index. */ /* function rest_get_avatar_urls() – Retrieves the avatar urls in various sizes. */ /* function rest_get_avatar_sizes() – Retrieves the pixel sizes for avatars. */ /* function rest_parse_date() – Parses an RFC3339 time into a Unix timestamp. */ /* function rest_parse_hex_color() – Parses a 3 or 6 digit hex color (with #). */ /* function rest_get_date_with_gmt() – Parses a date into both its local and UTC equivalent, in MySQL datetime format. */ /* function rest_authorization_required_code() – Returns a contextual HTTP error code for authorization failure. */ /* function rest_validate_request_arg() – Validate a request argument based on details registered to the route. */ /* function rest_sanitize_request_arg() – Sanitize a request argument based on details registered to the route. */ /* function rest_parse_request_arg() – Parse a request argument based on details registered to the route. */ /* function rest_is_ip_address() – Determines if an IP address is valid. */ /* function rest_sanitize_boolean() – Changes a boolean-like value into the proper boolean value. */ /* function rest_is_boolean() – Determines if a given value is boolean-like. */ /* function rest_is_integer() – Determines if a given value is integer-like. */ /* function rest_is_array() – Determines if a given value is array-like. */ /* function rest_sanitize_array() – Converts an array-like value to an array. */ /* function rest_is_object() – Determines if a given value is object-like. */ /* function rest_sanitize_object() – Converts an object-like value to an object. */ /* function rest_get_best_type_for_value() – Gets the best type for a value. */ /* function rest_handle_multi_type_schema() – Handles getting the best type for a multi-type schema. */ /* function rest_validate_array_contains_unique_items() – Checks if an array is made up of unique items. */ /* function rest_stabilize_value() – Stabilizes a value following JSON Schema semantics. */ /* function rest_validate_json_schema_pattern() – Validates if the JSON Schema pattern matches a value. */ /* function rest_find_matching_pattern_property_schema() – Finds the schema for a property using the patternProperties keyword. */ /* function rest_format_combining_operation_error() – Formats a combining operation error into a WP_Error object. */ /* function rest_get_combining_operation_error() – Gets the error of combining operation. */ /* function rest_find_any_matching_schema() – Finds the matching schema among the "anyOf" schemas. */ /* function rest_find_one_matching_schema() – Finds the matching schema among the "oneOf" schemas. */ /* function rest_are_values_equal() – Checks the equality of two values, following JSON Schema semantics. */ /* function rest_validate_enum() – Validates that the given value is a member of the JSON Schema "enum". */ /* function rest_get_allowed_schema_keywords() – Get all valid JSON schema properties. */ /* function rest_validate_value_from_schema() – Validate a value based on a schema. */ /* function rest_validate_null_value_from_schema() – Validates a null value based on a schema. */ /* function rest_validate_boolean_value_from_schema() – Validates a boolean value based on a schema. */ /* function rest_validate_object_value_from_schema() – Validates an object value based on a schema. */ /* function rest_validate_array_value_from_schema() – Validates an array value based on a schema. */ /* function rest_validate_number_value_from_schema() – Validates a number value based on a schema. */ /* function rest_validate_string_value_from_schema() – Validates a string value based on a schema. */ /* function rest_validate_integer_value_from_schema() – Validates an integer value based on a schema. */ /* function rest_sanitize_value_from_schema() – Sanitize a value based on a schema. */ /* function rest_preload_api_request() – Append result of internal request to REST API for purpose of preloading data to be attached to a page. */ /* function rest_parse_embed_param() – Parses the "_embed" parameter into the list of resources to embed. */ /* function rest_filter_response_by_context() – Filters the response to remove any fields not available in the given context. */ /* function rest_default_additional_properties_to_false() – Sets the "additionalProperties" to false by default for all object definitions in the schema. */ /* function rest_get_route_for_post() – Gets the REST API route for a post. */ /* function rest_get_route_for_post_type_items() – Gets the REST API route for a post type. */ /* function rest_get_route_for_term() – Gets the REST API route for a term. */ /* function rest_get_route_for_taxonomy_items() – Gets the REST API route for a taxonomy. */ /* function rest_get_queried_resource_route() – Gets the REST route for the currently queried object. */ /* function rest_get_endpoint_args_for_schema() – Retrieves an array of endpoint arguments from the item schema and endpoint method. */ /* function rest_convert_error_to_response() – Converts an error to a response object. */