Google Map Latitude and Longitude values in form

Take a look at this I did for a client: http://lpoc.co.uk/properties-for-sale/ A user can click the map and choose where to search. When a user clicks it updates a couple of hidden fields. Feel free to look at the source code to see how its done. If you want a more in depth description of … Read more

How to redirect new WordPress user to previous page after registering

There’s a registration_redirect filter you can use: add_filter( ‘registration_redirect’, ‘wpse_129618_registration_redirect’ ); function wpse_129618_registration_redirect( $redirect ) { if( isset( $_SERVER[‘HTTP_REFERER’] ) && 0 != strlen( $_SERVER[‘HTTP_REFERER’] ) ) { $redirect = esc_url( $_SERVER[‘HTTP_REFERER’] ); } return $redirect; } Alternately, you can edit the PHP that is generating your <form> and add a hidden field named redirect_to, … Read more

How to edit custom user meta information front end

I have solved it. In the redirect I changed if (count($error) == 0 ){ to if (count($error) < 1 ){ Also for any custom user meta fields added duplicated the following line and change the word ‘description’ to the name of the field create in your function file. if ( !empty( $_POST[‘description’] ) ) update_user_meta( … Read more

CRUD front end for mySQL in WordPress

Tom, I appreciate that WP doesn’t provide a CRUD type setup … I’m just wondering, whether these nice form-plugins that do a brilliant job in displaying and editing MySQL records of their own making within the WP-plugin-database could not do the same thing to a MySQL database on the same server. Again, I have been … Read more

How to submit form in a PHP file in WordPress?

I want to submit it to the file sub.php(which is in same directory) Don’t do this. You should not have standalone PHP files that get queried via forms or AJAX etc, WordPress handles all the requests. By having a standalone file, you open a can of worms of security issues, and other problems ( you … Read more

Help with forms and nonces

You need to pass the value of the nonce field as first argument to wp_verify_nonce. So, you need to modify the nonce verification part in your code. Also you were using form fields names that conflicts with internal wordpress query vars, you should prefix them with something unique so they do not conflict with wordpress. … Read more