Add filter to filter taxonomy term choices
-
In version 3.1 the filter
gfcpt_taxonomy_args
was added to allow modifying the arguments used to retrieve taxonomy terms.We would like to do the same for the taxonomy term choices in the backend.
Would you consider replacing
$terms = get_terms( $taxonomy, 'orderby=name&hide_empty=0' );
with the following code?$args = gf_apply_filters( 'gfcpt_taxonomy_args', array( $field->formId, $field->id ), array( 'taxonomy' => $taxonomy, 'orderby' => 'name', 'hide_empty' => 0 ), $field ); $terms = get_terms($args);
For the Post Type select box it would be useful to have the post type name in addition to the label. So replacing
<?php echo $post_type->label; ?>
with<?php echo $post_type->label . ' (' . $post_type->name . ')'; ?>
.It would look something like this:
Cheers
Ulrich
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Add filter to filter taxonomy term choices’ is closed to new replies.