uct reviews from showing in the comments page. * * @param array|mixed $args {@see WP_Comment_Query} query args. * @return array * * @internal For exclusive usage of WooCommerce core, backwards compatibility not guaranteed. */ public function exclude_reviews_from_comments( $args ): array { $screen = get_current_screen(); // We only wish to intervene if the edit comments screen has been requested. if ( ! $screen instanceof WP_Screen || 'edit-comments' !== $screen->id ) { return $args; } if ( ! empty( $args['post_type'] ) && $args['post_type'] !== 'any' ) { $post_types = (array) $args['post_type']; } else { $post_types = get_post_types(); } $index = array_search( 'product', $post_types ); if ( $index !== false ) { unset( $post_types[ $index ] ); } if ( ! is_array( $args ) ) { $args = []; } $args['post_type'] = $post_types; return $args; } }
Fatal error: Uncaught Automattic\WooCommerce\Internal\DependencyManagement\ContainerException: Attempt to get an instance of class 'Automattic\WooCommerce\Internal\Admin\ProductReviews\ReviewsCommentsOverrides', which doesn't exist. in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php:105 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php(78): Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer->get_core('Automattic\\WooC...', Array) #1 /htdocs/wp-content/plugins/woocommerce/src/Container.php(68): Automattic\WooCommerce\Internal\DependencyManagement\RuntimeContainer->get('Automattic\\WooC...') #2 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/Loader.php(74): Automattic\WooCommerce\Container->get('Automattic\\WooC...') #3 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/Loader.php(55): Automattic\WooCommerce\Internal\Admin\Loader->__construct() #4 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(205): Automattic\WooCommerce\Internal\Admin\Loader::get_instance() #5 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(109): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->hooks() #6 /htdocs/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(93): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->on_plugins_loaded() #7 /htdocs/wp-content/plugins/woocommerce/src/Admin/Composer/Package.php(65): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->init() #8 [internal function]: Automattic\WooCommerce\Admin\Composer\Package::init() #9 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(291): call_user_func(Array) #10 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(89): Automattic\WooCommerce\Packages::initialize_packages() #11 /htdocs/wp-includes/class-wp-hook.php(341): Automattic\WooCommerce\Packages::on_init('') #12 /htdocs/wp-includes/class-wp-hook.php(365): WP_Hook->apply_filters(NULL, Array) #13 /htdocs/wp-includes/plugin.php(522): WP_Hook->do_action(Array) #14 /htdocs/wp-settings.php(593): do_action('plugins_loaded') #15 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #16 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #17 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #18 /htdocs/index.php(17): require('/htdocs/wp-blog...') #19 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Internal/DependencyManagement/RuntimeContainer.php on line 105