Published On: 2020-08-19|Last Updated: 2022-11-05|Categories: WooCommerce, WordPress|
エラー詳細
===============
エラータイプ E_ERROR が /wp-content/plugins/woocommerce/includes/class-wc-query.php ファイルの 376 行目で発生しました。 エラーメッセージ: Uncaught Error: Call to undefined function wc_get_loop_prop() in /wp-content/plugins/woocommerce/includes/class-wc-query.php:376
Stack trace:
#0 /wp-content/plugins/woocommerce/includes/class-wc-query.php(363): WC_Query->adjust_total_pages()
#1 /wp-includes/class-wp-hook.php(289): WC_Query->handle_get_posts(Array)
#2 /wp-includes/plugin.php(249): WP_Hook->apply_filters(Array, Array)
#3 /wp-includes/class-wp-query.php(3190): apply_filters_ref_array('the_posts', Array)
#4 /wp-includes/class-wp-query.php(3448): WP_Query->get_posts()
#5 /wp-includes/class-wp-query.php(3559): WP_Query->query(Array)
#6 YOURFILE
困惑する人々

おそらく今日 (2020-08-19) 中に取り下げられるかフィックスされるだろうが、WordPress 5.5 でプラグイン等の自動更新が実装されたタイミングでこれは勘弁してほしい。

WooCommerce 4.4.1 で修正された模様 (2020-08-20 追記)

4.4.1 に含まれる、Add protection to run adjust methods only if product query. が修正と思われる。

対応方法

https://github.com/woocommerce/woocommerce/releases/tag/4.3.3 から woocommerce-4.3.3.zip をダウンロードし、上書きインストールする。WooCommerce 4.4 のデータベースのアップデートは手動で実行する必要があるが、迂闊に実行しないように。

余談

次のコードをどこかで実行していると、管理画面からプラグインの自動アップデートを個別に設定できない。

add_filter( 'auto_update_plugin', '__return_true' );

auto_update_plugin に加えて auto_update_theme、auto_update_translation は WordPress 5.5 以降では使用しない方が良いだろう。

関連