Yes
Create an ACF field, choose type = taxonomy, taxonomy = category, turn on the save terms and load terms settings, and add it to your form. Then create an image field and turn on the set as featured image setting and add it to your form
Thanks Shabti!
While this works to some extends it doesn’t fully fit my needs.
For example I can’t restrict the categories (there are some I dont want users to be able to add a post to).
I guess there’s no premade solution for that?
Thanks for your assistance!
-
This reply was modified 6 years ago by
rstackj.
For the dropdown, set Appearance to “multi select”
To restrict categories, Here is a piece of code you can drop into your functions.php in your child theme. In this example I am showing only categories who’s parent category has the ID of 18:
add_filter('acf/fields/taxonomy/query/name=name_of_your_field', 'restrict_field_taxonomy_query', 10, 3);
function restrict_field_taxonomy_query( $args, $field, $post_id ) {
$args[ 'parent' ] = 18;
// Order by most used.
$args[ 'include' ] = [ 18 ];
return $args;
}
Work’s flawlessly.
Thank’s for providing this kind of support in your free time!
-
This reply was modified 6 years ago by
rstackj.