Support

Account

Home Forums Feedback Part of Hierarchical Taxonomy

Helping

Part of Hierarchical Taxonomy

  • Hi,

    Is it possible to use only a part of a hierarchical Taxonomy in a Taxonomy-field?

    Example
    Taxonomy “tax123” in WordPress:
    Category 1
    – Subcategory 1.1
    – subcategory 1.2
    Category 2
    – Subcategory 2.1

    I want to use the Taxonomy for Category 1 only. Is it possible to filter the taxonomy before using it? Something like:

        acf_add_local_field(array(
        		'key' => 'test123',
        		'label' => 'Test',
        		'name' => 'test123',
        		'type' => 'taxonomy',
        		'instructions' => '',
        		'required' => 0,
        		'conditional_logic' => 0,
        		'wrapper' => array(
        				'width' => '',
        				'class' => '',
        				'id' => '',
        		),
        		'taxonomy' => 'tax123',
        		'field_type' => 'checkbox',
        		'child' => 'Category 1', //not an official parameter
        		'allow_null' => 0,
        		'add_term' => 0,
        		'save_terms' => 1,
        		'load_terms' => 0,
        		'return_format' => 'id',
        		'multiple' => 1,
        		'placeholder' => 'This is a test...',
        		'parent' => 'group_123'
        ));

    Result should be: [checkbox] Subcategory 1.1 [checkbox] subcategory 1.2

    Best regards
    Andre

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.