WP_REST_Revisions_Controller::prepare_date_response

Advertisement

Summery Summery

Checks the post_date_gmt or modified_gmt and prepare any post or modified date for single post output.

Syntax Syntax

WP_REST_Revisions_Controller::prepare_date_response( string $date_gmt, string|null $date = null )

Parameters Parameters

$date_gmt

(Required) GMT publication time.

$date

(Optional) Local publication time.

Default value: null

Return Return

(string|null) ISO8601/RFC3339 formatted datetime, otherwise null.

Source Source

File: wp-includes/rest-api/endpoints/class-wp-rest-revisions-controller.php

		if ( isset( $date ) ) {
			return mysql_to_rfc3339( $date );
		}

		return mysql_to_rfc3339( $date_gmt );
	}

	/**
	 * Retrieves the revision's schema, conforming to JSON Schema.
	 *

Advertisement

Changelog Changelog

Changelog
Version Description
4.7.0 Introduced.

Advertisement

Leave a Reply