Prevent stomping of global. Props prettyboymp. fixes #13945
git-svn-id: http://svn.automattic.com/wordpress/trunk@16303 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
c10218f665
commit
3a4671f530
|
@ -1344,8 +1344,8 @@ function wp_get_http_headers( $url, $deprecated = false ) {
|
||||||
* @return int 1 when new day, 0 if not a new day.
|
* @return int 1 when new day, 0 if not a new day.
|
||||||
*/
|
*/
|
||||||
function is_new_day() {
|
function is_new_day() {
|
||||||
global $day, $previousday;
|
global $currentday, $previousday;
|
||||||
if ( $day != $previousday )
|
if ( $currentday != $previousday )
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -1352,13 +1352,13 @@ function the_date_xml() {
|
||||||
* @return string|null Null if displaying, string if retrieving.
|
* @return string|null Null if displaying, string if retrieving.
|
||||||
*/
|
*/
|
||||||
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
|
||||||
global $day, $previousday;
|
global $currentday, $previousday;
|
||||||
$the_date = '';
|
$the_date = '';
|
||||||
if ( $day != $previousday ) {
|
if ( $currentday != $previousday ) {
|
||||||
$the_date .= $before;
|
$the_date .= $before;
|
||||||
$the_date .= get_the_date( $d );
|
$the_date .= get_the_date( $d );
|
||||||
$the_date .= $after;
|
$the_date .= $after;
|
||||||
$previousday = $day;
|
$previousday = $currentday;
|
||||||
|
|
||||||
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
|
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
|
||||||
|
|
||||||
|
@ -1564,11 +1564,11 @@ function the_weekday() {
|
||||||
function the_weekday_date($before='',$after='') {
|
function the_weekday_date($before='',$after='') {
|
||||||
global $wp_locale, $post, $day, $previousweekday;
|
global $wp_locale, $post, $day, $previousweekday;
|
||||||
$the_weekday_date = '';
|
$the_weekday_date = '';
|
||||||
if ( $day != $previousweekday ) {
|
if ( $currentday != $previousweekday ) {
|
||||||
$the_weekday_date .= $before;
|
$the_weekday_date .= $before;
|
||||||
$the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
|
$the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
|
||||||
$the_weekday_date .= $after;
|
$the_weekday_date .= $after;
|
||||||
$previousweekday = $day;
|
$previousweekday = $currentday;
|
||||||
}
|
}
|
||||||
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
|
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
|
||||||
echo $the_weekday_date;
|
echo $the_weekday_date;
|
||||||
|
|
|
@ -3188,13 +3188,13 @@ function wp_old_slug_redirect() {
|
||||||
* @return bool True when finished.
|
* @return bool True when finished.
|
||||||
*/
|
*/
|
||||||
function setup_postdata($post) {
|
function setup_postdata($post) {
|
||||||
global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages;
|
global $id, $authordata, $currentday, $currentmonth, $page, $pages, $multipage, $more, $numpages;
|
||||||
|
|
||||||
$id = (int) $post->ID;
|
$id = (int) $post->ID;
|
||||||
|
|
||||||
$authordata = get_userdata($post->post_author);
|
$authordata = get_userdata($post->post_author);
|
||||||
|
|
||||||
$day = mysql2date('d.m.y', $post->post_date, false);
|
$currentday = mysql2date('d.m.y', $post->post_date, false);
|
||||||
$currentmonth = mysql2date('m', $post->post_date, false);
|
$currentmonth = mysql2date('m', $post->post_date, false);
|
||||||
$numpages = 1;
|
$numpages = 1;
|
||||||
$page = get_query_var('page');
|
$page = get_query_var('page');
|
||||||
|
|
Loading…
Reference in New Issue