blob: 4f1dc854fb1d91998b44971ba51332d09650b617 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
<?php
class Users {
function init() {
add_filter( 'user_contactmethods', array( $this, 'add_custom_box_user' ), 10, 1 );
}
function add_custom_box_user($contact_methods) {
$new_methods = array(
array(
'service' => 'phone-number',
'label' => 'Phone number',
),
array(
'service' => 'address',
'label' => 'Address',
),
);
foreach ( $new_methods as $method ) {
if( ! isset( $contact_methods[$method['service']] ) ) {
$contact_methods[$method['service']] = $method['label'];
}
}
return $contact_methods;
}
}
|