Skip to content

Files

Latest commit

f467e1d · Jun 18, 2024

History

History

use-post-meta-value

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Jun 18, 2024
Jan 25, 2023

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 (
        ...
    );
}