diff --git a/packages/js/product-editor/src/utils/register-product-editor-block-type.ts b/packages/js/product-editor/src/utils/register-product-editor-block-type.ts index 3ac5c9a3716..eccb71b1603 100644 --- a/packages/js/product-editor/src/utils/register-product-editor-block-type.ts +++ b/packages/js/product-editor/src/utils/register-product-editor-block-type.ts @@ -16,14 +16,14 @@ interface BlockRepresentation< T extends Record< string, object > > { } function useEvaluationContext( context: Record< string, unknown > ) { - const { productType } = context; + const { postType } = context; - const productId = useEntityId( 'postType', productType ); + const productId = useEntityId( 'postType', postType ); const getEvaluationContext = ( select: typeof WPSelect ) => { const editedProduct = select( 'core' ).getEditedEntityRecord( 'postType', - productType, + postType, productId ); @@ -41,7 +41,7 @@ function useEvaluationContext( context: Record< string, unknown > ) { function augmentUsesContext( usesContext?: string[] ) { // Note: If you modify this function, also update the server-side // Automattic\WooCommerce\Admin\Features\ProductBlockEditor\BlockRegistry::augment_uses_context() function. - return [ ...( usesContext || [] ), 'productType' ]; + return [ ...( usesContext || [] ), 'postType' ]; } export function registerProductEditorBlockType< diff --git a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/BlockRegistry.php b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/BlockRegistry.php index e75da2cf4ca..1c48a2eee3e 100644 --- a/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/BlockRegistry.php +++ b/plugins/woocommerce/src/Admin/Features/ProductBlockEditor/BlockRegistry.php @@ -164,7 +164,7 @@ class BlockRegistry { return array_merge( isset( $uses_context ) ? $uses_context : [], [ - 'productType', + 'postType', ] ); }