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:
ryan 2010-11-11 16:22:18 +00:00
parent c10218f665
commit 3a4671f530
3 changed files with 9 additions and 9 deletions

View File

@ -1344,8 +1344,8 @@ function wp_get_http_headers( $url, $deprecated = false ) {
* @return int 1 when new day, 0 if not a new day.
*/
function is_new_day() {
global $day, $previousday;
if ( $day != $previousday )
global $currentday, $previousday;
if ( $currentday != $previousday )
return 1;
else
return 0;

View File

@ -1352,13 +1352,13 @@ function the_date_xml() {
* @return string|null Null if displaying, string if retrieving.
*/
function the_date( $d = '', $before = '', $after = '', $echo = true ) {
global $day, $previousday;
global $currentday, $previousday;
$the_date = '';
if ( $day != $previousday ) {
if ( $currentday != $previousday ) {
$the_date .= $before;
$the_date .= get_the_date( $d );
$the_date .= $after;
$previousday = $day;
$previousday = $currentday;
$the_date = apply_filters('the_date', $the_date, $d, $before, $after);
@ -1564,11 +1564,11 @@ function the_weekday() {
function the_weekday_date($before='',$after='') {
global $wp_locale, $post, $day, $previousweekday;
$the_weekday_date = '';
if ( $day != $previousweekday ) {
if ( $currentday != $previousweekday ) {
$the_weekday_date .= $before;
$the_weekday_date .= $wp_locale->get_weekday(mysql2date('w', $post->post_date, false));
$the_weekday_date .= $after;
$previousweekday = $day;
$previousweekday = $currentday;
}
$the_weekday_date = apply_filters('the_weekday_date', $the_weekday_date, $before, $after);
echo $the_weekday_date;

View File

@ -3188,13 +3188,13 @@ function wp_old_slug_redirect() {
* @return bool True when finished.
*/
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;
$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);
$numpages = 1;
$page = get_query_var('page');