B
B
bigfootua2018-04-16 15:42:02
WordPress
bigfootua, 2018-04-16 15:42:02

What is the Use of undefined constant WP_LANG_DIR error?

Notice: Use of undefined constant WP_LANG_DIR - assumed 'WP_LANG_DIR' in /home/savyc146/domains/example.ua/public_html/wp-includes/l10n.php on line 719

Error on Wordpress site Line 718-733 of l10n.php
file
spoiler
// Try to load from the languages directory first.
if ( load_textdomain( $domain, WP_LANG_DIR . '/plugins/' . $mofile ) ) {
return true;
}
if ( false !== $plugin_rel_path ) {
$path = WP_PLUGIN_DIR . '/' . trim( $plugin_rel_path, '/' );
} elseif ( false !== $deprecated ) {
_deprecated_argument( __FUNCTION__, '2.7.0' );
$path = ABSPATH . trim( $deprecated, '/' );
} else {
$path = WP_PLUGIN_DIR;
}
return load_textdomain( $domain, $path . '/' . $mofile );
}

Tell me how to fix it, I think because of this error 500 pops up when creating pages / posts / media and even menu items.
Thank you very much for your attention

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
iljaGolubev, 2018-04-16
@iljaGolubev

https://github.com/WordPress/WordPress/blob/280aef...

I
Igor Vorotnev, 2018-04-17
@HeadOnFire

In general, this constant is either manually set in wp-config.php (at an early stage of loading), if you need to change the standard path to translation files, or set by the engine later , in the wp-includes/load.php file, with the following value:
WordPress looks, if it was not defined in wp-config.php, then it defines itself. There shouldn't be any mistakes . If you have an error, then this, as it were, hints that your kernel boot process has been modified, something you are doing wrong. This error should not be.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question