Refactor WPFunctions to be injectable with DI
This commit is contained in:
@@ -16,11 +16,12 @@ class Date {
|
||||
'mtext' => 'F',
|
||||
'y' => 'Y'
|
||||
);
|
||||
$wp = new WPFunctions();
|
||||
if(!empty($action_mapping[$shortcode_details['action']])) {
|
||||
return date_i18n($action_mapping[$shortcode_details['action']], WPFunctions::currentTime('timestamp'));
|
||||
return date_i18n($action_mapping[$shortcode_details['action']], $wp->currentTime('timestamp'));
|
||||
}
|
||||
return ($shortcode_details['action'] === 'custom' && $shortcode_details['action_argument'] === 'format') ?
|
||||
date_i18n($shortcode_details['action_argument_value'], WPFunctions::currentTime('timestamp')) :
|
||||
date_i18n($shortcode_details['action_argument_value'], $wp->currentTime('timestamp')) :
|
||||
false;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user