我在上一个版本(3.5.8)中覆盖了WooCommerce中的邮件样式 上次更新后,邮件样式不起作用。调试时出现错误
PHP Fatal error: Uncaught Error: Call to a member function appendChild() on null in plugins/woocommerce/includes/libraries/class-emogrifier.php:1419
我希望邮件能够工作而不删除$headElementappendChild($styleElement);
行代码
我已注释掉$headElement-> appendChild ($ styleElement)
,一切看起来都不错。因此,我相信问题出在邮件CSS中。我尝试删除customer-completed-order.php
中的自定义CSS,但是没有任何变化。
我删除了customer-completed-order.php
和email-styles.php
,调试器显示了相同的问题。
删除子级的所有文件后,邮件将使用默认样式。
May-2019 13:46:50 UTC] PHP Fatal error: Uncaught Error: Call to a member function appendChild() on null in /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/libraries/class-emogrifier.php:1419
堆栈跟踪:
#0 /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/libraries/class-emogrifier.php(1328): Pelago\Emogrifier->addStyleElementToDocument('@media only scr...')
#1 /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/libraries/class-emogrifier.php(526): Pelago\Emogrifier->copyUninlineableCssToStyleNode(Object(DOMXPath), Array)
#2 /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/libraries/class-emogrifier.php(377): Pelago\Emogrifier->process()
#3 /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/emails/class-wc-email.php(535): Pelago\Emogrifier->emogrify()
#4 /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/wooco in /home/256865.cloudwaysapps.com/wkratgvfzw/public_html/wp-content/plugins/woocommerce/includes/libraries/class-emogrifier.php on line 1419