[wp-trac] [WordPress Trac] #34967: SHORTINIT and date_i18n: Call to undefined function _x()
WordPress Trac
noreply at wordpress.org
Thu Dec 10 09:40:29 UTC 2015
#34967: SHORTINIT and date_i18n: Call to undefined function _x()
----------------------------+-----------------------------
Reporter: djzone | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Bootstrap/Load | Version: 4.4
Severity: normal | Keywords:
Focuses: |
----------------------------+-----------------------------
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
<?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 :(
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34967>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list