'html']; $this->pattern_registry->register_block_pattern( $pattern['ID'], $pattern, $this->dictionary ); } } /** * Parse prefixed categories from the PTK patterns into the actual WooCommerce categories. * * @param array $patterns The patterns to parse. * @return array The parsed patterns. */ private function parse_categories( array $patterns ) { return array_map( function ( $pattern ) { $pattern['categories'] = array_map( function ( $category ) { foreach ( self::CATEGORIES_PREFIXES as $prefix ) { if ( strpos( $category['title'], $prefix ) !== false ) { $parsed_category = str_replace( $prefix, '', $category['title'] ); $parsed_category = str_replace( '_', ' ', $parsed_category ); $category['title'] = ucfirst( $parsed_category ); } } return $category; }, $pattern['categories'] ); return $pattern; }, $patterns ); } }
Fatal error: Uncaught Error: Class "Automattic\WooCommerce\Blocks\BlockPatterns" not found in /htdocs/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php:406 Stack trace: #0 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Domain\Bootstrap->Automattic\WooCommerce\Blocks\Domain\{closure}(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #1 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #2 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #3 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php(169): Automattic\WooCommerce\Blocks\Registry\Container->get('Automattic\\WooC...') #4 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php(86): Automattic\WooCommerce\Blocks\Domain\Bootstrap->init() #5 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Package.php(105): Automattic\WooCommerce\Blocks\Domain\Bootstrap->__construct(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #6 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/AbstractDependencyType.php(42): Automattic\WooCommerce\Blocks\Package::Automattic\WooCommerce\Blocks\{closure}(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #7 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/SharedType.php(28): Automattic\WooCommerce\Blocks\Registry\AbstractDependencyType->resolve_value(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #8 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Registry/Container.php(96): Automattic\WooCommerce\Blocks\Registry\SharedType->get(Object(Automattic\WooCommerce\Blocks\Registry\Container)) #9 /htdocs/wp-content/plugins/woocommerce/src/Blocks/Package.php(44): Automattic\WooCommerce\Blocks\Registry\Container->get('Automattic\\WooC...') #10 [internal function]: Automattic\WooCommerce\Blocks\Package::init() #11 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(128): call_user_func(Array) #12 /htdocs/wp-content/plugins/woocommerce/src/Packages.php(64): Automattic\WooCommerce\Packages::initialize_packages() #13 /htdocs/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Packages::on_init('') #14 /htdocs/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array) #15 /htdocs/wp-includes/plugin.php(517): WP_Hook->do_action(Array) #16 /htdocs/wp-settings.php(559): do_action('plugins_loaded') #17 /htdocs/wp-config.php(98): require_once('/htdocs/wp-sett...') #18 /htdocs/wp-load.php(50): require_once('/htdocs/wp-conf...') #19 /htdocs/wp-blog-header.php(13): require_once('/htdocs/wp-load...') #20 /htdocs/index.php(17): require('/htdocs/wp-blog...') #21 {main} thrown in /htdocs/wp-content/plugins/woocommerce/src/Blocks/Domain/Bootstrap.php on line 406