summaryrefslogtreecommitdiffstats
path: root/wp-includes/rest-api.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--wp-includes/rest-api.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/wp-includes/rest-api.php b/wp-includes/rest-api.php
index 5bf4887..7aa2534 100644
--- a/wp-includes/rest-api.php
+++ b/wp-includes/rest-api.php
@@ -323,14 +323,6 @@ function create_initial_rest_routes() {
$controller = new WP_REST_Block_Types_Controller();
$controller->register_routes();
- // Global Styles revisions.
- $controller = new WP_REST_Global_Styles_Revisions_Controller();
- $controller->register_routes();
-
- // Global Styles.
- $controller = new WP_REST_Global_Styles_Controller();
- $controller->register_routes();
-
// Settings.
$controller = new WP_REST_Settings_Controller();
$controller->register_routes();
@@ -1015,7 +1007,11 @@ function rest_output_link_wp_head() {
$resource = rest_get_queried_resource_route();
if ( $resource ) {
- printf( '<link rel="alternate" type="application/json" href="%s" />', esc_url( rest_url( $resource ) ) );
+ printf(
+ '<link rel="alternate" title="%1$s" type="application/json" href="%2$s" />',
+ _x( 'JSON', 'REST API resource link name' ),
+ esc_url( rest_url( $resource ) )
+ );
}
}
@@ -1040,7 +1036,14 @@ function rest_output_link_header() {
$resource = rest_get_queried_resource_route();
if ( $resource ) {
- header( sprintf( 'Link: <%s>; rel="alternate"; type="application/json"', sanitize_url( rest_url( $resource ) ) ), false );
+ header(
+ sprintf(
+ 'Link: <%1$s>; rel="alternate"; title="%2$s"; type="application/json"',
+ sanitize_url( rest_url( $resource ) ),
+ _x( 'JSON', 'REST API resource link name' )
+ ),
+ false
+ );
}
}
@@ -1277,7 +1280,7 @@ function rest_get_avatar_sizes() {
* @param string $date RFC3339 timestamp.
* @param bool $force_utc Optional. Whether to force UTC timezone instead of using
* the timestamp's timezone. Default false.
- * @return int Unix timestamp.
+ * @return int|false Unix timestamp on success, false on failure.
*/
function rest_parse_date( $date, $force_utc = false ) {
if ( $force_utc ) {
@@ -1299,7 +1302,7 @@ function rest_parse_date( $date, $force_utc = false ) {
* @since 5.4.0
*
* @param string $color 3 or 6 digit hex color (with #).
- * @return string|false
+ * @return string|false Color value on success, false on failure.
*/
function rest_parse_hex_color( $color ) {
$regex = '|^#([A-Fa-f0-9]{3}){1,2}$|';