Hi @beelinedigital
I hope you are doing well.
Do you need to show the category on the front end?
If not,
Could you try this workaround that I believe fits well here?
Add this code as a mu-plugin:
<?php
add_action( 'forminator_post_data_field_post_saved', function( $post_id, $field, $data ){
$category = (int) $_POST['hidden-1'];
// $categories = [ 1, 2, 3 ];
if( $category ){
wp_set_post_categories( $post_id, $category );
//wp_set_post_categories( $post_id, $categories );
}else{
// Default category if no category is defined on hidden field, this conditional can be removed.
wp_set_post_categories( $post_id, [ 157 ] );
}
}, 99, 3);
Create a hidden field, set it to a custom value and then set the category ID that you would like to use.
https://monosnap.com/file/jM76xzMoknnr2RMLmz7P8wu9bTn7ja
Remove the default category field in Post data, and then on form submission, it will set to that custom category on the hidden field.
You can also extend the code to multiple categories or more conditionals, in case you would like to show it on the frontend then you could add the category as a Select field or regular HTML field.
To learn more about how mu-plugin works https://wpmudev.com/blog/wordpress-mu-plugins/
Also is it possible to set it so posts are automatically published.
It is, you can change the field setting:
https://monosnap.com/file/mxyNG6PqHLg70CMyP8IQVvfEJPKEbJ
Best Regards
Patrick Freitas