Notice: require(): read of 1939 bytes failed with errno=12 Cannot allocate memory in /home/tvsazfgs/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90
Notice: require(): read of 1939 bytes failed with errno=12 Cannot allocate memory in /home/tvsazfgs/public_html/wp-content/plugins/jetpack/vendor/jetpack-autoloader/class-php-autoloader.php on line 90
reach ( $block['innerBlocks'] as $inner_block ) {
$this->extract_single_product_inner_block_names( $inner_block, $result );
}
}
return $result;
}
/**
* Replace the global post for the Single Product inner blocks and reset it after.
*
* This is needed because some of the inner blocks may use the global post
* instead of fetching the product through the `productId` attribute, so even if the
* `productId` is passed to the inner block, it will still use the global post.
*
* @param array $block Block attributes.
* @param array $context Block context.
*/
protected function replace_post_for_single_product_inner_block( $block, &$context ) {
if ( $this->single_product_inner_blocks_names ) {
$block_name = array_pop( $this->single_product_inner_blocks_names );
if ( $block_name === $block['blockName'] ) {
/**
* This is a temporary fix to ensure the Post Title and Excerpt blocks work as expected
* until Gutenberg versions 15.2 and 15.6 are included in the core of WordPress.
*
* Important: the original post data is restored in the restore_global_post method.
*
* @see https://github.com/WordPress/gutenberg/pull/48001
* @see https://github.com/WordPress/gutenberg/pull/49495
*/
if ( 'core/post-excerpt' === $block_name || 'core/post-title' === $block_name ) {
global $post;
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited
$post = get_post( $this->product_id );
if ( $post instanceof \WP_Post ) {
setup_postdata( $post );
}
}
$context['postId'] = $this->product_id;
$context['singleProduct'] = true;
}
}
}
/**
* Get the frontend script handle for this block type.
*
* @param string $key Data to get, or default to everything.
*
* @return null This block has no frontend script.
*/
protected function get_block_type_script( $key = null ) {
return null;
}
}
Fatal error: Uncaught Error: Class 'Automattic\WooCommerce\Blocks\BlockTypes\SingleProduct' not found in /home/tvsazfgs/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php:65
Stack trace:
#0 /home/tvsazfgs/public_html/wp-includes/class-wp-hook.php(310): Automattic\WooCommerce\Blocks\BlockTypesController->register_blocks('')
#1 /home/tvsazfgs/public_html/wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters(NULL, Array)
#2 /home/tvsazfgs/public_html/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /home/tvsazfgs/public_html/wp-settings.php(632): do_action('init')
#4 /home/tvsazfgs/public_html/wp-config.php(95): require_once('/home/tvsazfgs/...')
#5 /home/tvsazfgs/public_html/wp-load.php(50): require_once('/home/tvsazfgs/...')
#6 /home/tvsazfgs/public_html/wp-blog-header.php(13): require_once('/home/tvsazfgs/...')
#7 /home/tvsazfgs/public_html/index.php(17): require('/home/tvsazfgs/...')
#8 {main}
thrown in /home/tvsazfgs/public_html/wp-content/plugins/woocommerce/packages/woocommerce-blocks/src/BlockTypesController.php on line 65