get_feed_build_date

Advertisement

Summery Summery

Get the UTC time of the most recently modified post from WP_Query.

Syntax Syntax

get_feed_build_date( string $format )

Description Description

If viewing a comment feed, the time of the most recently modified comment will be returned.

Parameters Parameters

$format

(Required) Date format string to return the time in.

Return Return

(string|false) The time in requested format, or false on failure.

Source Source

File: wp-includes/feed.php

}

/**
 * Display the link for the currently displayed feed in a XSS safe way.
 *
 * Generate a correct link for the atom:self element.
 *
 * @since 2.5.0
 */
function self_link() {
	/**
	 * Filters the current feed URL.
	 *
	 * @since 3.6.0
	 *
	 * @see set_url_scheme()
	 * @see wp_unslash()
	 *
	 * @param string $feed_link The link for the feed with set URL scheme.
	 */
	echo esc_url( apply_filters( 'self_link', get_self_link() ) );
}

/**
 * Get the UTC time of the most recently modified post from WP_Query.
 *
 * If viewing a comment feed, the time of the most recently modified
 * comment will be returned.
 *
 * @global WP_Query $wp_query WordPress Query object.
 *
 * @since 5.2.0
 *
 * @param string $format Date format string to return the time in.
 * @return string|false The time in requested format, or false on failure.
 */
function get_feed_build_date( $format ) {
	global $wp_query;

	$datetime          = false;
	$max_modified_time = false;
	$utc               = new DateTimeZone( 'UTC' );

	if ( ! empty( $wp_query ) && $wp_query->have_posts() ) {

Advertisement

Changelog Changelog

Changelog
Version Description
5.2.0 Introduced.

Advertisement

Leave a Reply