問題の概要
ACFMLと組み合わせてAdvanced Custom Fieldsを使用している場合、セカンダリ言語のACFオプションページでネストされたフィールドを保存する際に致命的なエラーが発生する場合があります。
Fatal error: Uncaught TypeError: md5(): Argument
#1 ($string) must be of type string, array given in .../wp-content/plugins/acfml/classes/Strings/Package.php:174
回避策
作業を進める前に、必ずサイトの完全なバックアップを取得してください。
- …/wp-content/plugins/acfml/classes/Options/EditorHooks.phpファイルを開きます。
- 308行目付近にある
registerFieldTranslation関数を探します。 - 以下のコードを:
if ( null === $originalValue || false === $originalValue ) { return; } - 次のコードに置き換えます:
if ( null === $originalValue || false === $originalValue || ! is_scalar( $originalValue ) ) { return; }