Home › Forums › ACF PRO › Google Maps into Taxonomies › Reply To: Google Maps into Taxonomies
Hello John,
thanks so far, but how does it work if I use taxonomies created with CPT UI plugin?
Also, I don’t want to show the taxonomy in the post. It should work under the hood. Will I need another fieldset?
Right now I am a little confused 😊
With your help I made it this far. But/where can I find the Term ids?
function my_copy_date_filter( $post_id ) {
$post_type = get_post_type( $post_id );
if ( $post_type != 'spot' ) {
return;
}
$location = get_field( 'spot_location', $post_id );
if( $location[ 'lat' ] && $location[ 'lng' ] ) {
update_field( 'spot_coordinates', $location[ 'lat' ].','.$location[ 'lng' ], $post_id );
}
if( $location[ 'state' ] ) {
update_field( 'spot_bundesland', $location[ 'state' ], 'term_'.$term_id );
}
if( $location[ 'city' ] ) {
update_field( 'spot_stadt', $location[ 'city' ], 'term_'.$term_id );
}
if( $location[ 'address' ] ) {
update_field( 'spot_address', $location[ 'address' ], $post_id );
}
}
add_filter( 'acf/save_post', 'my_copy_date_filter', 20 );
Greetings from Cologne,
Denis
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.