WordPress PHP fatal error: Undefined function trailingslashit() called when trying to update plugin
P粉216807924
P粉216807924 2023-10-23 12:54:50
0
1
545

We installed WordPress on provider wpengine. We encountered a fatal PHP error in our theme when we tried to update some plugins. Provider support doesn't know how to help us. This is the wrong call stack:

"PHP Fatal Error: Uncaught Error: Call to undefined function Trailingslashit() in /nas/content/live/sillaindustrie/wp-includes/class-wp-textdomain-registry.php: 103n Stack trace: n# 0 /nas/content/live/sillaindustrie/wp-includes/l10n.php(784): WP_Textdomain_Registry->set('default', 'it_IT', '/nas/content/li...')n#1 /nas/content/live/sillaindustrie/wp-includes/load.php(1401): load_textdomain('default', '/nas/content/li...', 'it_IT')n#2 /nas/content/ live/sillaindustrie/wp-includes/load.php(278): wp_load_translations_early()n#3 /nas/content/live/sillaindustrie/wp-settings.php(74): wp_maintenance()n#4 /nas/content/ live/sillaindustrie/wp-config.php(67): require_once('/nas/content/li...')n#5 /nas/content/live/sillaindustrie/wp-load.php(50) : require_once( '/nas/content/li...')n#6 /nas/content/live/sillaindustrie/wp-blog-header.php(13): require_once('/nas/content/li.. .')n #7 /nas/content/live/sillaindustrie/index.php(17): require('/nas/content/li...')n#8 {main}n throw into /nas /content/live/sillaindustrie/ Line 103 of wp-includes/class-wp-textdomain-registry.php, reference: https://silla.industries/wp-admin/update-core.php?action=do-plugin-upgrade”

It seems to be related to the WPML plugin or similar, any suggestions? Thanks G.

I tried updating the WordPress plugin but I can't understand where the error is coming from. Maybe the plugin is incompatible but I don't know how to detect it.

P粉216807924
P粉216807924

reply all (1)
P粉323374878

As others have pointed out, this is a problem when the code inwp-includes/class-wp-textdomain-registrywp-includes/formatting.phpis not available .phpRun. This is an issue introduced inWordPress 6.1.

To resolve this issue, you can change line 103 inwp-includes/class-wp-textdomain-registry.phpto:

$this->all[ $domain ][ $locale ] = $path ? trailingslashit( $path ) : false;

To:

$this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/\' ). '/' : false;
    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!