Author | Posts |
---|---|
April 17, 2013 at 3:19 pm 2370 | |
This theme seems complicated and it’s using custom taxonomy for item locations. It’s saving the location info in wp_options table and I must say it’s BAD. | |
April 17, 2013 at 3:46 pm 2373 | |
That might be the custom taxonomy that refers to event-locations though. Could be wrong. | |
April 17, 2013 at 4:24 pm 2374 | |
They’re using the Nette Framework that’s being used over the WPLatte-framework. There’s a so-called .neon file apparently that holds all the metabox’s content. I’ll try and see if I can write to those fields somehow. | |
April 17, 2013 at 4:57 pm 2376 | |
Sorry to spam, but all I can find is the action hook add_meta_boxes that looks like what we need. Only thing is that I don’t know how to hook into it with the plugin. | |
April 17, 2013 at 5:07 pm 2378 | |
Can you share the theme with me? | |
April 17, 2013 at 5:29 pm 2383 | |
Sent it to info@wedevs.com (it’s a paid theme) | |
April 18, 2013 at 2:08 am 2407 | |
This solution will work for you. [php] $def_lat = $def_long = 0; if ( isset( $_POST[‘location’] ) ) { $ait_dir_item = array ( update_post_meta( $post_id, ‘_ait-dir-item’, $ait_dir_item ); add_action( ‘wpuf_add_post_after_insert’, ‘wpufe_ait_integration’ ); You can’t use the themes default meta box, because it’s using kinda weird neon file. Just use the plugins default custom fields and use the to update your `_ait-dir-item` custom fields. All is needed to put the right `$_POST` value in that array. I am using the plugins google map and as it stores longitude and latitude in the same field, I am just exploding them and saving it to different array index. Hope that makes sense. | |
April 18, 2013 at 5:14 am 2415 | |
WOW! It works! Tareq my man. Just gimme a sign how much a sixpack of your favorite beverage costs and I’ll paypal it over straight away! I’ll let all other WP Directory users know immediately! Thanks a LOT! 😀 | |
April 18, 2013 at 8:22 am 2438 | |
Hey Retroga 🙂 ! I’m the same guys that had answered your post on ait themes support. So I’m happy you’ve found the right solution 🙂 ! Could you explain me in details ? An other problem is that I have 150 agencies in a .csv and want to import them in WP Director. How can I do if I want to keep all the locations data etc… ?
Thanks | |
April 18, 2013 at 8:27 am 2440 | |
I helped you by testing the theme myself because you were gentle enough, not like yelling for support :). I am not a fan of beverages, if you really want to donate, use this page, but that wouldn’t be necessary ;). | |
April 18, 2013 at 10:19 am 2446 | |
All you have to do is put the php code Tareq posted here inside your wpuf-functions.php and use the plugin to add the form fields to the plugin form. You can use the item-dir.neon file in the I’ve tested it and I can confirm it works, however (maybe unrelated) can’t get the registration forms to work properly using the shortcode. If you could test that too, we could exclude it being a theme error. Cheers and thanks again! | |
July 18, 2013 at 8:48 am 6102 | |
Wonderful solution, works perfectly. Thank you! Is there any way with this ait-directory integration to enable auto-population of the user’s address on the google map with geolocation on the front end posting? In other words, instead of the user filling in the post address can the map detect their location and fill in the address and/or GPS for them? | |
July 18, 2013 at 2:24 pm 6107 | |
You could auto populate, in that case you’ve to depend on users browser and permission. It always doesn’t work correctly. | |
August 17, 2013 at 1:00 pm 7057 | |
Ok, I put this script in the wpuf-functions.php and it works great. The only thing I can not figure out is how to get the gmaps info. In the backend you enter the address like broadway, new york and then press the find address button and it finds the right location on the map. I created a form with the following fields: address –> metakey = address So how do I get the right coordinates when I save the item. I would like to combine address and city, calculate the coordinates and then save it in the meta field location. I have also tried a field with metakey ‘address’ ad then enter broadway, new york but then I still have to press the button ‘find address’in the backend. Hope you can help | |
August 18, 2013 at 2:35 am 7085 | |
If you add google map field with meta key |