giovanni645
Forum Replies Created
-
Forum: Plugins
In reply to: [GEO my WP] Trying to add location to post from frontendIt’s a submit content form.
After some more research, I’ve realized if I set that theme to do nothing once video is uploaded and I press save again, the location on the post gets updated just fine.
I just have to figure out how to use a hook that waits till the file is fully uploaded or add into the scripts an automatic save twice.
The next step would be to initialize the auto complete script within the pop-up.
Forum: Plugins
In reply to: [GEO my WP] update location meta from FrontendI finally realized that I am facing the same issue. If after submission, I set up my theme to do nothing, and press Save again. The location actually does get geocoded and added to the post!
Have you found a simple workaround to this problem yet?
Forum: Plugins
In reply to: [GEO my WP] Trying to add location to post from frontendThose addresses were added using the edit post page.
What should I write in the address field on the sub.it content form for it to show up automatically on the post? Is it getting geocoded automatically?
How can I get the auto complete to work inside the pop-up. It works fine on the main page.
Forum: Plugins
In reply to: [GEO my WP] Trying to add location to post from frontendI’ve added a field as this in the submit content popup like so:
$options[‘_config’][‘address’] = array(
‘label’ => esc_html__(‘Address’, ‘uploader-plugin’),
‘type’ => ‘text’,
‘attrs’ => array(
‘id’ => ‘address’,
‘layout’ => ‘uploader/text’,
‘validation’ => ‘required’)
);which shows as follow:
<div class=”form-group exc-form-field”><label for=”address” class=”col-sm-2″>Address</label><div class=”col-sm-6″><input name=”address” type=”text” id=”address” layout=”uploader/text” validation=”required” value=””>
</div></div>Also, done this in the theme_functions.php file:
function gmw_update_post_type_post_location( $post_id ) {
// Return if it’s a post revision.
if ( false !== wp_is_post_revision( $post_id ) ) {
return;
}// check autosave.
if ( defined( ‘DOING_AUTOSAVE’ ) && DOING_AUTOSAVE ) {
return;
}// check if user can edit post.
if ( ! current_user_can( ‘edit_post’, $post_id ) ) {
return;
}// get the address from the custom field “address”.
$address = get_post_meta( $post_id, ‘address’, true );
echo $address;
// varify that address exists.
if ( empty( $address ) ) {
return;
}// verify the updater function.
if ( ! function_exists( ‘gmw_update_post_location’ ) ) {
return;
}//run the udpate location function
gmw_update_post_location( $post_id, $address );}
//execute the function whenever post type is being updated
add_action( ‘save_post’, ‘gmw_update_post_type_post_location’, 10, 1);