PluginProbe
Booktics – Appointment Booking Calendar for Service Businesses / 1.0.21
Booktics – Appointment Booking Calendar for Service Businesses v1.0.21
1.0.25 1.0.24 1.0.23 1.0.22 1.0.21 1.0.20 1.0.19 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 All 27 releases
booktics / core / admin / team-member-password-reset.php

team-member-password-reset.php in Booktics – Appointment Booking Calendar for Service Businesses 1.0.21, at core/admin/team-member-password-reset.php

45 lines 955 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Booktics\Admin;
4
5 if ( ! defined( 'ABSPATH' ) ) exit;
6
7 use Booktics\Contracts\Hookable_Service_Contract;
8 use Booktics\Models\Team_Member_Model;
9
10 /**
11 * Handles team member password reset functionality
12 *
13 * @package Booktics\Admin
14 */
15 class Team_Member_Password_Reset implements Hookable_Service_Contract {
16
17 /**
18 * Register WordPress hooks
19 *
20 * @return void
21 */
22 public function register() {
23 add_action(
24 'password_reset', array(
25 $this,
26 'password_reset_action',
27 ), 10, 2
28 );
29 }
30
31 /**
32 * Handle password reset action for team members
33 *
34 * @param $user
35 * @param $new_pass
36 *
37 * @return void
38 */
39 public function password_reset_action( $user, $new_pass ) {
40 $team_member_id = $user->ID;
41 $team_member = new Team_Member_Model( $team_member_id );
42 $team_member->update( array( 'status' => 'active' ) );
43 }
44 }
45