Add date/time option to use WP and ignore QTX formats #1248
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
strftime
function is deprecated in PHP8.1 but the legacy language formats are still maintained withIntlDateFormatter
(#1228, #1238). The strftime format used in the qTranslate language options should be deprecated (#1234). The date format should also be refactored without intermediate legacy conversions.Meanwhile, it is safer to add a fallback option to disable any date/time conversion and hooks in qTranslate in case something unexpected would happen. This option could be enough for some users. The standard WP behavior for
the_time()
and all filters withget_post_modified_time
is translating the global date/time WP formats. However when calling functions likeget_post_time()
from the code without any argument, no translation is done which could be unexpected when using qTranslate. Also, the WP options only allow to define a format for date and another for time, which could also be too restrictive.