| 1 |
<?php |
| 2 |
|
| 3 |
namespace Texty\Admin; |
| 4 |
|
| 5 |
use WP_User; |
| 6 |
|
| 7 |
/** |
| 8 |
* Profile Class |
| 9 |
*/ |
| 10 |
class Profile { |
| 11 |
|
| 12 |
/** |
| 13 |
* Initialize |
| 14 |
*/ |
| 15 |
public function __construct() { |
| 16 |
add_filter( 'user_contactmethods', [ $this, 'add_contact_methods' ], 8, 2 ); |
| 17 |
} |
| 18 |
|
| 19 |
/** |
| 20 |
* Add phone number as contact method |
| 21 |
* |
| 22 |
* @param array $methods |
| 23 |
* @param WP_User $user |
| 24 |
* |
| 25 |
* @return array |
| 26 |
*/ |
| 27 |
public function add_contact_methods( $methods, $user ) { |
| 28 |
$methods['texty_phone'] = __( 'Phone Number (Texty)', 'texty' ); |
| 29 |
|
| 30 |
return $methods; |
| 31 |
} |
| 32 |
} |
| 33 |
|