Opened 11 years ago
Closed 11 years ago
#34967 closed defect (bug) (fixed)
SHORTINIT and date_i18n: Call to undefined function _x()
| Reported by: | djzone | Owned by: | SergeyBiryukov |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.4.1 |
| Component: | Bootstrap/Load | Version: | 4.4 |
| Severity: | normal | Keywords: | has-patch fixed-major |
| Cc: | Focuses: |
Description
When SHORTINIT is used together with date_i18n() wp-includes/l10n.php is not loaded, and results the following error:
Fatal error: Call to undefined function _x() in /wp-includes
/functions.php on line 178
The following code can be used to reproduce the error:
<?php define('SHORTINIT', true); require_once('./wp-load.php'); $now = date_i18n('Y-m-d H:i:s');
This bug appeared in 4.4, with 4.3.1 it worked fine.
I've tried to investigate what happend since 4.3.1 that causes this change, I've find out that it's neither wp-settings.php nor wp-load.php.
I believe a wp_load_translations_early() call somewhere has been moved since 4.3.1, but I could not find that in revision history :(
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Introduced in [35517].
SHORTINITbails earlier thanl10n.phpis loaded: tags/4.0/src/wp-settings.php#L101.