Home  >  Q&A  >  body text

WordPress PHP fatal error: Undefined function trailingslashit() called when trying to update plugin

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粉216807924P粉216807924336 days ago590

reply all(1)I'll reply

  • P粉323374878

    P粉3233748782023-10-24 00:54:00

    As others have pointed out, this is a problem when the code in wp-includes/class-wp-textdomain-registry wp-includes/formatting.php is not available .php Run. This is an issue introduced in WordPress 6.1.

    To resolve this issue, you can change line 103 in wp-includes/class-wp-textdomain-registry.php to:

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

    To:

    $this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/\' ). '/' : false;

    reply
    0
  • Cancelreply