Taxonomy field

The Taxonomy field type is used to present the user with a dropdown with different taxonomy types. One taxonomy can be selected.

Return

Returns the slug of the selected taxonomy.

If no taxonomy is selected it returns an empty string.

Extended Return Values

When Extended Return Values are enabled an array with useful information will be returned. It will contain the following information:

Example


// field slug is "taxonomyExample"
$taxonomy_slug = simple_fields_value('taxonomyExample');
$taxonomy_info = get_taxonomy($taxonomy_slug);
echo "You have selected a taxonomy with the slug $taxonomy_slug and the name $taxonomy_info";

Output of above

You have selected a taxonomy with the slug categories and the name Categories

Leave a Reply