data->user_pass, $user->ID)) { $creds = array('user_login' => $user->data->user_login, 'user_password' => $_POST['password']); $creds['remember'] = true; } $user = wp_signon( $creds, false ); if ( !is_wp_error($user) ): echo 'success'; endif; } endif; wp_die(); } public function booked_ajax_forgot(){ booked_wpml_ajax(); global $wpdb, $wp_hasher; if (isset($_POST['security']) && isset($_POST['username'])): $nonce_check = wp_verify_nonce( $_POST['security'], 'ajax_forgot_nonce' ); if ($nonce_check){ $password_reset = booked_reset_password( $_POST['username'] ); if ( $password_reset ): echo 'success'; endif; } endif; wp_die(); } public function booked_add_appt(){ booked_wpml_ajax(); $can_add_appt = apply_filters( 'booked_can_add_appt', isset($_POST['date']) && isset($_POST['timestamp']) && isset($_POST['timeslot']) && isset($_POST['customer_type']) ); if ( $can_add_appt ): include(BOOKED_AJAX_INCLUDES_DIR . 'front/book-appointment.php'); endif; wp_die(); } public function booked_cancel_appt(){ booked_wpml_ajax(); if (is_user_logged_in() && isset($_POST['appt_id'])): include(BOOKED_AJAX_INCLUDES_DIR . 'front/cancel-appointment.php'); endif; wp_die(); } } }