Hi,
A default for a taxonomy field is not supported in the current version. But this feature is definately on my todo list for the next version
cheers
Brad
Brad, just to let you know. When you can’t set a “selected” value then conditionals will not work out the gate for say hiding the submit button if dropdown is not “– select a Taxonomy Term –“.
You should at least set the first item as “selected”
Hey Brad, I went ahead and added the whole feature as I needed it for a project.
See diff and new file here: https://gist.github.com/2402893
@geet Jacobs – You can just copy and paste (replace) the whole code into your gfcptaddonbase.php (https://gist.github.com/2402893#file_gfcptaddonbase.php)
Hey styledev
thanks for that code 🙂
I will go through it and incorporate this into the next version
cheers
Brad
Anytime, feels good to contribute back to the community 🙂
@styledev,
Thanks so much, exactly what I needed!
@brad, Thanks for your time and work on this excellent addon to gravityforms.
I made some updates to my gist code. There was an issue with my $selected code when using Single Line Text with Save to Taxonomy that through an error. This is now accounted for and fixed.
hey guys,
Please could you test out the new beta version : http://themergency.com/gravity-forms-custom-post-types-v4-beta-testers-wanted/
@styledev, I included code to take into account the selected items, although my implementation is quite different from yours. Please could you test it out to make sure it works for you.
thanks for help on this
@bradvin, Everything looks good to me for the “selected items” issue. Great work! I love this plugin 🙂 Any way I can float some money your way?
One other thing, can you add a away to specify which post statuses you want to display. Currently the plugin only allows Published but for my recent project I needed to show Pending aswell.
/*
* Get a hierarchical list of posts
*/
function load_posts_hierarchical( $post_type ) {
$args = array(
'post_type' => $post_type,
'numberposts' => -1,
'orderby' => 'title',
'post_status' => 'publish,pending'
);
$args = apply_filters( 'gfcpt_get_post_args', $args );
$posts = get_posts( $args );
$posts = apply_filters( 'gfcpt_get_post_filter', $posts );
return $this->walk_posts( $posts );
}
@styledev, thanks – you can donate via paypal if you want, but it is not neccessary 🙂 http://themergency.com/donate/
I think I can add this post_status feature into V4
Awesome and I just donated a little something for you. Keep up the great work!
Awesome work guys, this just saved me a ton of time!
Thanks for this, I just tried it out, works great. Saved me a ton of time!