is_new_day() WordPress Function

The is_new_day() function is used to check if the current day is a new day. This function returns true if the current day is a new day, and false if it is not.

is_new_day() #

Determines whether the publish date of the current post in the loop is different from the publish date of the previous post in the loop.


Description

For more information on this and similar theme functions, check out the Conditional Tags article in the Theme Developer Handbook.


Top ↑

Return

(int) 1 when new day, 0 if not a new day.


Top ↑

Source

File: wp-includes/functions.php

function is_new_day() {
	global $currentday, $previousday;

	if ( $currentday !== $previousday ) {
		return 1;
	} else {
		return 0;
	}
}


Top ↑

Changelog

Changelog
VersionDescription
0.71Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More