Skip to content

Latest commit

 

History

History

use-primary-term

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 

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