- License: GPLv2 or later
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
- Requires at least: 3.4
- Tested up to: 5.3
- Stable tag: 1.0
The Taxonomy Selector field allows the selection of one or more taxonomies.
Provides a new field type, for the Advanced Custom Fields WordPress plugin, which allows users to select of one or more taxonomies.
The field is based on Tim Perry's Post Type Selector field type.
This ACF field type is compatible with:
- ACF 5
- ACF 4
- ACF 3
The field type can be used as plugin, must-use plugin, a Composer package, and a theme include.
$ composer require mcaskill/acf-field-taxonomy-selector
- Download the latest ZIP of this repo.
- In your WordPress admin panel, navigate to Plugins → Add New.
- Click Upload Plugin.
- Upload the ZIP file that you downloaded.
Then activate the plugin via wp-cli.
$ wp plugin activate acf-field-taxonomy-selector
Or through the WordPress admin panel (Plugins → ACF Taxonomy Selector → Activate).
-
Download the latest ZIP of this repo.
-
Extract the plugin from the ZIP file you downloaded.
-
Upload the directory into your theme's directory.
-
Edit your theme's
functions.php
file to include the plugin's main PHP file:add_action( 'acf/register_fields', 'register_my_acf_fields' ); function register_my_acf_fields() { include_once '{acf-taxonomy-selector}/acf-taxonomy-selector.php'; }
$taxonomy_name = get_field('taxonomy');
$taxonomy_object = get_taxonomy( $taxonomy_name );
echo '<h2>' . $taxonomy_object->label . '</h2>';
$terms = get_terms( $taxonomy_name );
if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
echo '<ul>';
foreach ( $terms as $term ) {
echo '<li>' . $term->name . '</li>';
}
echo '</ul>';
}
- Initial Release