[wp-trac] [WordPress Trac] #45227: Using "__" in a plugin's main file, outside of an action callback prevents post saving in the editor.

WordPress Trac noreply at wordpress.org
Tue Oct 30 21:40:41 UTC 2018


#45227: Using "__" in a plugin's main file, outside of an action callback prevents
post saving in the editor.
--------------------------+------------------------------
 Reporter:  kmgalanakis   |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  I18N          |     Version:  5.0
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------------------

Comment (by joshf):

 @Chouby You're correct. ACF 5.7.7 on an otherwise vanilla 5.0-beta2
 installation triggers a fatal error when attempting to save a post.

 {{{
 [30-Oct-2018 21:25:23 UTC] PHP Fatal error:  Uncaught Error: Call to
 undefined function is_user_logged_in() in /Users/sb05/sites/wp-beta2/wp-
 includes/l10n.php:137
 Stack trace:
 #0 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(1051):
 determine_locale()
 #1 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(1013):
 _get_path_to_translation_from_lang_dir('acf')
 #2 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(983):
 _get_path_to_translation('acf')
 #3 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(1081):
 _load_textdomain_just_in_time('acf')
 #4 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(170):
 get_translations_for_domain('acf')
 #5 /Users/sb05/sites/wp-beta2/wp-includes/l10n.php(250):
 translate('Advanced Custom...', 'acf')
 #6 /Users/sb05/sites/wp-beta2/wp-content/plugins/advanced-custom-fields-
 pro/acf.php(80): __('Advanced Custom...', 'acf')
 #7 /Users/sb05/sites/wp-beta2/wp-content/plugins/advanced-custom-fields-
 pro/acf.php(690): ACF->initial in /Users/sb05/sites/wp-beta2/wp-
 includes/l10n.php on line 137
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/45227#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list