Skip to content

Commit

Permalink
Fix filter on wp_date
Browse files Browse the repository at this point in the history
  • Loading branch information
parsakafi committed Nov 24, 2019
1 parent d5ce040 commit f305455
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions includes/fixes-dates.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
add_filter('get_comment_date', 'wpp_fix_comment_date', 10, 2);
add_filter('get_post_modified_time', 'wpp_fix_post_modified_time', 10, 3);
add_filter('date_i18n', 'wpp_fix_i18n', 10, 4);
add_filter('wp_date', 'wpp_fix_wp_date', 10, 4);
add_filter('wp_date', 'wpp_fix_i18n', 10, 4);
}

/**
Expand Down Expand Up @@ -154,8 +154,7 @@ function wpp_fix_comment_date($time, $format = '')
*/
function wpp_fix_i18n($date, $format, $timestamp, $gmt)
{
global $wpp_settings;
global $post;
global $wpp_settings, $post;
$post_id = !empty($post) ? $post->ID : null;

if (!disable_wpp())
Expand All @@ -170,9 +169,10 @@ function wpp_fix_i18n($date, $format, $timestamp, $gmt)
function wpp_fix_wp_date($date, $format, $timestamp, $timezone)
{
global $wpp_settings;

if (!disable_wpp())
return $format;
//$timestamp = eng_number($timestamp);

return parsidate($format, $timestamp, $wpp_settings['conv_dates'] == 'disable' ? 'eng' : 'per');
}

Expand Down

0 comments on commit f305455

Please sign in to comment.