WordPress PHP致命錯誤:嘗試更新外掛程式時呼叫未定義的函數trailingslashit()
P粉216807924
P粉216807924 2023-10-23 12:54:50

我們在提供者 wpengine 上安裝了 WordPress。當我們嘗試更新某些外掛程式時,我們在主題中遇到致命的 PHP 錯誤。提供者支援不知道如何幫助我們。這是錯誤的呼叫堆疊:

「PHP 致命錯誤:未捕獲錯誤:呼叫/nas/content/live/sillaindustrie/wp-includes/class-wp-textdomain-registry.php 中未定義的函數Trailingslashit():103n堆疊追蹤: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/內容/ 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 丟進/nas /content/live/sillaindustrie/ wp-includes/class-wp-textdomain-registry.php 第103 行,參考:https://silla.industries/wp-admin/update-core.php?action=do-plugin-升級」

它似乎與 WPML 外掛程式或類似外掛程式有關,有什麼建議嗎? 謝謝 G.

我嘗試更新 WordPress 插件,但我無法理解錯誤的來源。也許是插件不相容,但我不知道如何發現它。

P粉216807924
P粉216807924

全部回覆(1)
P粉323374878

正如其他人所指出的,當wp-includes/class-wp-textdomain-registry 中的程式碼時,wp-includes/formatting.php 不可用,這是一個問題.php 運行。這是WordPress 6.1 引入的問題

要解決此問題,您可以將 wp-includes/class-wp-textdomain-registry.php 中的第 103 行變更為:

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

致:

$this->all[ $domain ][ $locale ] = $path ? rtrim( $path, '/\' ). '/' : false;
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!