- ステータス
- 開発者により解決済み
- 解決されたバージョン
- WoodMart 8.0.2
- 関連するプラグイン/テーマ
- Woodmart
- トピックタグ
- Compatibility
問題の概要
WPMLと併用してWoodmartテーマを使用している場合、Product Layoutの翻訳が途中で停止し、完了しない問題が発生することがあります。さらに、同様のエラーが表示されます。
Call to a member function get_gallery_image_ids() on null .../wp-content/themes/woodmart/woocommerce/single-product/product-image.php:27
回避策
続行する前に、必ずサイトの完全なバックアップを取得してください。
- テーマのfunctions.phpファイルを開きます。
- 次のスニペットを追加します。
add_action( 'woocommerce_before_template_part', function () { global $product; if ( wp_is_json_request() && ! $product ) { $random_product = new WP_Query( array( 'posts_per_page' => '1', 'post_type' => 'product', ) ); while ( $random_product->have_posts() ) { $random_product->the_post(); $product_id = get_the_ID(); } wp_reset_postdata(); $product = wc_get_product( $product_id ); } } ); - キャッシュをクリアし、製品レイアウトを再翻訳します。
- WordPressダッシュボード -> WoodMart -> Patcherに移動します。
- パッチ番号618307を選択します。