Skip to content

Latest commit

 

History

History
20 lines (14 loc) · 461 Bytes

File metadata and controls

20 lines (14 loc) · 461 Bytes

usePrimaryTerm

The usePrimaryTerm hook retrieves the primary term of any given taxonomy.

Warning This hook will not function without having Yoast SEO installed and activated.

Usage

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

function BlockEdit(props) {
    const [primaryCategory, isSupportingCategory] = usePrimaryTerm('category');

    return (
        ...
    );
}