Forum Replies Created
-
AuthorPosts
-
Hi Chris,
Added the beta and it seems to be working! One thing to note was that the “loading” circle was appearing below the map even once the map was finished loading but I just changed the css to make it disappear. It could have been some kind of conflict on my site too I suppose. Thanks!
hi Chris,
As a follow-up, I think I ALMOST have it working through this function which I placed in functions.php. The only issue now is: the custom field “Address Complete” will be filled with the meta from the other boxes if it is empty but will not overwrite if there is something already there! If I can figure out that one thing I think this should do it. Any idea?
// AUTO COMBINE CUSTOM FIELDS ON LOCATIONS
add_action('publish_locations', 'add_custom_field_automatically');
add_action('update_locations', 'add_custom_field_automatically');
function add_custom_field_automatically($post_ID) {
global $wpdb;
get_post_custom($GLOBALS['post']->ID);
$add1 = get_post_meta( $GLOBALS['post']->ID, 'Address Line 1', true );
$add2 = get_post_meta( $GLOBALS['post']->ID, 'Address Line 2', true );
$addcity = get_post_meta( $GLOBALS['post']->ID, 'City', true );
$addzip = get_post_meta( $GLOBALS['post']->ID, 'Zip Code', true );
$addcomp= $add1 . ' ' . $add2 . ' ' . $addcity . ' ' . $addzip;
if(!wp_is_post_revision($post_ID)) {
add_post_meta($post_ID, 'Address Complete', $addcomp, false) or update_post_meta($post_ID, 'Address Complete', $addcomp, false);
}
}Hi Chris,
I made this post last time as well (under blrboston) but just bought the 3 pack again for another website project. It seems that I still cannot choose the MapPress address from multiple custom fields as described above. I took a look at what you mentioned in regard to save_posts and am still trying to work through it, but it is a bit complex for my understanding. Have you implemented a less obvious way to do this in MapPress? If not, could you please give a bit better perspective on how to go about it?
This feature is even more important for the client I’m working with now and any help would be very greatly appreciated!
-
AuthorPosts
