Skip to content

Latest commit

 

History

History
22 lines (17 loc) · 646 Bytes

File metadata and controls

22 lines (17 loc) · 646 Bytes

useSelectedTermsOfSavedPost

The useSelectedTermsOfSavedPost hook retrieves the ids of the selected terms of the provided taxonomy. It gets used internally by the useSelectedTerms hook which is a more full featured version of this hook.

Usage

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

function BlockEdit(props) {
    const { context } = props;
    const { postId } = context;
    const [
        selectedCategoriesOfSavedPost,
        hasResolvedSelectedCategoriesOfSavedPost
    ] = useSelectedTermsOfSavedPost('category', postId);

    return (
        ...
    );
}