rest_url() - WordPress 函数参考中文文档

返回介绍

rest_url()

发布于 2017-09-11 字数 3971 浏览 742 评论 0

rest_url( string $path = '',  string $scheme = 'json' )

Retrieves the URL to a REST endpoint.


描述

Note: The returned URL is NOT escaped.


参数

$path

(string)
(Optional)
REST route.

Default value: ”

$scheme

(string)
(Optional)
Sanitization scheme.

Default value: ‘json’


返回值

(string) Full URL to the endpoint.


源代码

File: wp-includes/rest-api.php

function rest_url( $path = '', $scheme = 'json' ) {
	return get_rest_url( null, $path, $scheme );
}

更新日志

Version 描述
4.4.0 Introduced.

相关函数

Uses

  • wp-includes/rest-api.php:
    get_rest_url()

Used By

  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::prepare_links()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php:
    WP_REST_Users_Controller::get_items()
  • wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php:
    WP_REST_Revisions_Controller::prepare_item_for_response()
  • wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php:
    WP_REST_Attachments_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-statuses-controller.php:
    WP_REST_Post_Statuses_Controller::prepare_item_for_response()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::prepare_links()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-terms-controller.php:
    WP_REST_Terms_Controller::get_items()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::prepare_links()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php:
    WP_REST_Posts_Controller::get_items()
  • wp-includes/rest-api/endpoints/class-wp-rest-taxonomies-controller.php:
    WP_REST_Taxonomies_Controller::prepare_item_for_response()
  • wp-includes/rest-api/endpoints/class-wp-rest-post-types-controller.php:
    WP_REST_Post_Types_Controller::prepare_item_for_response()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::prepare_links()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::create_item()
  • wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php:
    WP_REST_Comments_Controller::get_items()
  • wp-includes/rest-api/class-wp-rest-request.php:
    WP_REST_Request::from_url()
  • wp-includes/embed.php:
    get_oembed_endpoint_url()
  • wp-includes/rest-api/class-wp-rest-server.php:
    WP_REST_Server::get_data_for_route()
  • wp-includes/rest-api/class-wp-rest-server.php:
    WP_REST_Server::get_namespace_index()
  • wp-includes/media.php:
    wp_enqueue_media()
  • Show 17 more used by
    Hide more used by


User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!