Delete user from frontend

Taken directly form the wp_delete_user documentation: if(is_user_logged_in() && !empty($_GET[‘DeleteMyAccount’])) { add_action(‘init’, ‘remove_logged_in_user’); } function remove_logged_in_user() { require_once(ABSPATH.’wp-admin/includes/user.php’ ); $current_user = wp_get_current_user(); wp_delete_user( $current_user->ID ); } Things to note: Your code didn’t check if the user was logged in or not by the time you’re printing the remove user link, the init action has already happened … Read more

Frontend Post Excerpt field mapping

I haven’t tried the Gravity Forms plugin but if you are using the wp_insert_post function to insert the new post, you just use ‘post_excerpt’. example: $new_post = array( ‘post_title’ => ‘Post Title’, ‘post_content’ => ‘Post Content’, ‘post_status’ => ‘publish’, ‘post_excerpt’ => $custom_excerpt_field ); wp_insert_post($new_post); Not sure if I completely understand your question, so I’ve misunderstood … Read more

front end publishing not working on front-end page

thanks to @TheDeadMedic, I found the solution. I used reserved terms, and that’s why WordPress interpreted my inputs as query parameters. so for example with my categorys, I had to change my classes in my form : ‘post_category’ => array($_POST[‘cat’]), // Usable for custom taxonomies too by ‘post_category’ => array($_POST[‘my_cat’]), // Usable for custom taxonomies … Read more

Frontend Password change

I think you are referring to two different things.. 1) Verifying the request. You should be using WP Nonces to verify the request and protect it against XSS. That should be a practice for all your forms. you could also add additional layer of security by integrating a reCAPTCHA. 2) Data Encryption when you attempt … Read more

Datepicker not supporting timepicker

WordPress supports only datepicker. If you want to add timepicker in datepicker you have to use jquery-ui-timepicker-addon as extension in your theme or plug-in. Add css and js as below add_action(‘wp_enqueue_scripts’, ‘custom_datepicker’); function custom_datepicker() { //wp_enqueue_script(‘jquery-ui-datepicker’); //wp_enqueue_script(‘jquery-ui-core’); wp_enqueue_script(‘jquery-ui-timepicker-addon’,get_stylesheet_directory_uri().’/js/jquery-ui-timepicker-addon.js’,array()); wp_enqueue_style(‘jquery-ui-timepicker-addon’,get_stylesheet_directory_uri().’/css/jquery-ui-timepicker-addon.css’,array()); wp_enqueue_style(‘jquery-ui’,get_stylesheet_directory_uri().’/css/jquery-ui.css’,array()); } You can download all css and js files from this link http://trentrichardson.com/examples/timepicker/ Call timepicker … Read more

Saving and displaying content on front end with wp_editor

You want to submit the data to admin_post_(action) and then handle the request. You may need jQuery to intercept the click and supply all the required data, but this shows you the main parts. HTML <form action=”http://www.example.com/wp-admin/admin-post.php” method=”post”> <input type=”hidden” name=”action” value=”add_foobar”> <input type=”hidden” name=”data” value=”foobarid”> <input type=”submit” value=”Submit”> </form> PHP add_action( ‘admin_post_foobar’, ‘prefix_admin_foobar’ ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)