Beautiful Taxonomy Filters

Developer documentation for the Beautiful Taxonomy Filters WordPress plugin.

View the Project on GitHub beautiful-taxonomy-filters/beautiful-taxonomy-filters

Beautiful Taxonomy Filters

Developer documentation for Beautiful Taxonomy Filters, the WordPress plugin that adds term filtering to custom post type archives and turns the result into pretty URLs like /recipes/cuisine/thai/diet/vegan/.

Showing the modules

Pick whichever fits your theme:

<?php do_action( 'show_beautiful_filters_info' ); ?>
<?php do_action( 'show_beautiful_filters', 'your_post_type' ); // The post type is optional on its archive. ?>

Scripts and styles

The plugin’s scripts, select2 included, are only loaded on pages where a filter module is rendered through one of the methods above, and they load deferred. If you build your own form markup instead, enqueue them yourself:

wp_enqueue_script( 'beautiful-taxonomy-filters' );

The stylesheets load on every page. A stylesheet enqueued while the page renders is printed at the bottom of it, which would make the filter flash unstyled.

Hooks

Almost every setting and every bit of output can be changed with a filter, and there are actions for adding your own markup around the modules.

Hooks reference →

Help and contributing