Skip to content

Latest commit

 

History

History
17 lines (12 loc) · 451 Bytes

File metadata and controls

17 lines (12 loc) · 451 Bytes

usePostMetaValue

The usePostMetaValue hook allows you to read and write meta values of the current post. It either references the global post, or when used within a <PostContext /> it reference that post.

Usage

import { usePostMetaValue } from '@10up/block-components';

function BlockEdit(props) {
    const [price, setPrice] = usePostMetaValue( 'price' );

    return (
        ...
    );
}