It would be great to have support for custom taxonomies in the post tag field.
Cheers!
It would be great to have support for custom taxonomies in the post tag field.
Cheers!
Well, for anybody looking to implement cutom taxonomies, you can do it by using the gform_post_submission hook and custom fields. Something like this:
function tj_add_xtra_data( $form )
{
if( $form['source_url'] == get_permalink( 824 ) )
{
require_once( WP_CONTENT_DIR . '/plugins/geo-mashup/geo-mashup-db.php' );
$id = $form['post_id'];
$lat = $form['8'];
$lng = $form['14'];
$post_location['lat'] = trim( $lat );
$post_location['lng'] = trim( $lng );
// save the location
GeoMashupDB::set_post_location( $id, $post_location );
// set the custom taxonomies
wp_set_object_terms( $id, $form['10'], 'countries' );
wp_set_object_terms( $id, $form['11'], 'continents' );
wp_set_object_terms( $id, $form['12'], 'cities' );
// delete all unneeded post meta
delete_post_meta( $id, 'tj_longitude' );
delete_post_meta( $id, 'tj_latitude' );
delete_post_meta( $id, 'tj_continent' );
delete_post_meta( $id, 'tj_country' );
delete_post_meta( $id, 'tj_city' );
}
}
add_action( 'gform_post_submission', 'tj_add_xtra_data' );
What I did here was also integrate GF with the GeoMashup plugin. At the beginning I check for the correct form and in the end I delete all the post meta we don't need any more. All you'd have to do is change the field numbers/permalink id around to fit your needs.
Nice! We do plan on adding native support for custom taxonomies as an option on the Post Tag field. It's good to see you putting the available hooks to accomplish things. Good stuff.
I've actually been thinking about it and I'll probably leave my solution in once you add support for custom taxonomies. I only want my users to add one tag. I guess native support would allow multiple tags...
Yes, but we may be able to set it up so that you can set a limit on how many tags and then validation can check to see how many tags were submitted and throw a validation error if they submit more than the limit was set to.
Now that would be perfect :)
Am I missing options for custom taxonomies within the latest version?
Is there a development version that has the ability?
Thanks.
No, we don't have built in support for custom taxonomies via the UI. However, we do have hooks that can be used to accomplish that.
I am looking to implement forms solution with geo-Mashup plugin but would like to avoid coding a solution as Boris did.
Is there a GUI based solution to geo-mashup integration that requires no coding now?
Cheers
Ben
I am also extremely interest about that!!!
@Matosd, have you seen this 3rd party plugin at the WordPress repository?
http://wordpress.org/extend/plugins/gravity-forms-custom-post-types/
It was not created by us, but might help you.