rest_url( string $path = '', string $scheme = 'json' )
Retrieves the URL to a REST endpoint.
Description
Note: The returned URL is NOT escaped.
Parameters
- $path
-
(string) (Optional) REST route.
Default value: ''
- $scheme
-
(string) (Optional) Sanitization scheme.
Default value: 'json'
Return
(string) Full URL to the endpoint.
Source
File: wp-includes/rest-api.php
function rest_url( $path = '', $scheme = 'json' ) {
return get_rest_url( null, $path, $scheme );
}
Related
Uses
Uses | Description |
---|---|
wp-includes/rest-api.php: get_rest_url() |
Retrieves the URL to a REST endpoint on a site. |
Used By
Used By | Description |
---|---|
wp-includes/rest-api/class-wp-rest-server.php: WP_REST_Server::get_data_for_route() |
Retrieves publicly-visible data for the route. |
wp-includes/rest-api/class-wp-rest-request.php: WP_REST_Request::from_url() |
Retrieves a WP_REST_Request object from a full URL. |
wp-includes/rest-api/class-wp-rest-server.php: WP_REST_Server::get_namespace_index() |
Retrieves the index for a namespace. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::get_items() |
Retrieves a list of comment items. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::create_item() |
Creates a comment. |
wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php: WP_REST_Comments_Controller::prepare_links() |
Prepares links for the request. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::get_items() |
Retrieves all users. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::create_item() |
Creates a single user. |
wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php: WP_REST_Users_Controller::prepare_links() |
Prepares links for the user request. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::get_items() |
Retrieves terms associated with a taxonomy. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::create_item() |
Creates a single term in a taxonomy. |
wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php: WP_REST_Terms_Controller::prepare_links() |
Prepares links for the request. |
wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php: WP_REST_Attachments_Controller::create_item() |
Creates a single attachment. |
wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php: WP_REST_Taxonomies_Controller::prepare_item_for_response() |
Prepares a taxonomy object for serialization. |
wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php: WP_REST_Revisions_Controller::prepare_item_for_response() |
Prepares the revision for the REST response. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::prepare_links() |
Prepares links for the request. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::get_schema_links() |
Retrieve Link Description Objects that should be added to the Schema for the posts collection. |
wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php: WP_REST_Post_Types_Controller::prepare_item_for_response() |
Prepares a post type object for serialization. |
wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php: WP_REST_Post_Statuses_Controller::prepare_item_for_response() |
Prepares a post status object for serialization. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::get_items() |
Retrieves a collection of posts. |
wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php: WP_REST_Posts_Controller::create_item() |
Creates a single post. |
wp-includes/media.php: wp_enqueue_media() |
Enqueues all scripts, styles, settings, and templates necessary to use all media JS APIs. |
wp-includes/embed.php: get_oembed_endpoint_url() |
Retrieves the oEmbed endpoint URL for a given permalink. |
Changelog
Version | Description |
---|---|
WP-4.4.0 | Introduced. |