Dynamic Taxonomies

The Dynamic Taxonomies module allows you to register and manage custom taxonomies from your WordPress admin, in Tools > Taxonomies menu.

All native taxonomies settings can be set within the UI. ACF Extended also adds more advanced settings allowing to manage posts per page, order etc…

Dynamic Taxonomy

The name of the taxonomy. Name should only contain lowercase letters and the underscore character, and not be more than 32 characters long (database structure restriction)

Include a description of the taxonomy

Is this taxonomy hierarchical (have descendants) like categories or not hierarchical like tags

Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users

Whether the taxonomy is publicly queryable

A function name that will be called when the count of an associated $object_type, such as post, is updated

Provide a callback function name for the meta box display.

Defaults to the categories meta box for hierarchical taxonomies and the tags meta box for non-hierarchical taxonomies. No meta box is shown if set to false.

Whether this taxonomy should remember the order in which terms are added to objects

Whether to generate a default UI for managing this post type in the admin

Where to show the taxonomy in the admin menu. show_ui must be true

true makes this taxonomy available for selection in navigation menus

Whether to allow the Tag Cloud widget to use this taxonomy

Whether to show the taxonomy in the quick/bulk edit panel

Whether to allow automatic creation of taxonomy columns on associated post-types table

/wp-content/themes/acf-extended/

ACF Extended: Which template file to load for the term query. More informations on Template hierarchy

ACF Extended: Number of posts to display on the admin list screen

ACF Extended: Sort retrieved posts by parameter in the admin list screen. Defaults to 'date (post_date)'.

ACF Extended: Designates the ascending or descending order of the 'orderby' parameter in the admin list screen. Defaults to 'DESC'.

Set to false to prevent automatic URL rewriting a.k.a. "pretty permalinks". Pass an argument array to override default URL settings for permalinks

Use additional rewrite arguments

Used as pretty permalink text (i.e. /tag/) - defaults to $taxonomy (taxonomy's name slug)

Allowing permalinks to be prepended with front base

True or false allow hierarchical urls

Additional arguments

ACF Extended: Number of terms to display on the admin list screen

ACF Extended: Sort retrieved terms by parameter in the admin list screen. Accepts term fields 'name', 'slug', 'term_group', 'term_id', 'id', 'description', 'parent', 'count' (for term taxonomy count), or 'none' to omit the ORDER BY clause

ACF Extended: Designates the ascending or descending order of the 'orderby' parameter in the admin list screen. Defaults to 'ASC'.

An array of labels for this taxonomy. By default tag labels are used for non-hierarchical types and category labels for hierarchical ones.

Default: if empty, name is set to label value, and singular_name is set to name value.

An array of the capabilities for this taxonomy:

manage_terms : edit_posts
edit_terms : edit_posts
delete_terms : edit_posts
assign_terms : edit_posts

Whether to include the taxonomy in the REST API. Set this to true for the taxonomy to be available in the block editor

To change the base url of REST API route

REST API Controller class name

Advanced Settings

The module comes with additional settings that allows an advanced control over taxonomies.

SettingDescription
Front: Single Posts per pageSet posts per page
Front: Single Order/OrderbySet order/orderby setting
Front: Single TemplateSet custom template. Example: my-taxonomy-single.php
Admin: List Posts Per PageSet posts per page
Admin: List Order/Order bySet order/orderby setting

Export/Import Taxonomies

It is possible to export and import Taxonomies in a Json file using the ACF > Tools menu. Taxonomies can also be exported in PHP format, to manually register them in the functions.php file. Those tools are also available directly within the Dynamic Taxonomies UI.

Register Taxonomies in PHP

Taxonomies can be registered using register_taxonomy() and benefit from ACF Extended advanced settings like “Front: Single Posts Per Page” or “Admin: List Order/Order by”. See documentation. Usage example:

add_action('init', 'my_init');
function my_init(){
    
    register_taxonomy('my-taxonomy', array('my-post-type'), array(

        'label' => 'My Taxonomy',
        
        // Front
        'acfe_single_template' => 'my-taxonomy-single.php',
        'acfe_single_ppp' => 999,
        'acfe_single_orderby' => 'title',
        'acfe_single_order' => 'ASC',
        
        // Admin
        'acfe_admin_ppp' => 999,
        'acfe_admin_orderby' => 'title',
        'acfe_admin_order' => 'ASC'
        
    ));
    
}

Existing Taxonomies

Advanced settings can be used in already existing taxonomies using the register_taxonomy_args hook. See documentation. Usage example:

add_filter('register_taxonomy_args', 'my_taxonomy_args', 10, 3);
function my_taxonomy_args($args, $taxonomy, $post_types){
    
    // Target "my-taxonomy"
    if($taxonomy !== 'my-taxonomy')
        return $args;
    
    // Set Front: Archive Posts Per Page
    $args['acfe_single_ppp'] = 999;
    
    // Return
    return $args;
    
}

Disable the module

This module is enabled by default. To disable it, you can use the following code:

add_action('acf/init', 'my_acfe_modules');
function my_acfe_modules(){

    // Disable Dynamic Taxonomies
    acfe_update_setting('modules/dynamic_taxonomies', false);
    
    // Or:
    acf_update_setting('acfe/modules/dynamic_taxonomies', false);
    
}