-
Notifications
You must be signed in to change notification settings - Fork 60
/
Copy pathusers.php
69 lines (62 loc) · 1.77 KB
/
users.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
/**
* Remove social contact methods
*/
add_filter(
'user_contactmethods',
function ( $contact_methods ) {
unset( $contact_methods['facebook'] );
unset( $contact_methods['instagram'] );
unset( $contact_methods['linkedin'] );
unset( $contact_methods['myspace'] );
unset( $contact_methods['pinterest'] );
unset( $contact_methods['soundcloud'] );
unset( $contact_methods['tumblr'] );
unset( $contact_methods['twitter'] );
unset( $contact_methods['youtube'] );
unset( $contact_methods['wikipedia'] );
return $contact_methods; // or you could just return an empty array to remove them all
}
);
/**
* Hide profile fields
*
* @link https://developer.wordpress.org/reference/hooks/admin_print_scripts-hook_suffix/
*
* Visual Editor - .user-rich-editing-wrap
* Syntax Highlighting - .user-syntax-highlighting-wrap
* Admin Color Scheme - .user-admin-color-wrap
* Keyboard Short - .user-comment-shortcuts-wrap
* Show Toolbar - .show-admin-bar
* Language - .user-language-wrap
*
* First name - .user-first-name-wrap
* Last name - .user-last-name-wrap
* Nickname - .user-nickname-wrap
* Biographical Info - .user-description-wrap
*/
if ( ! function_exists( 'hide_profile_fields_with_css' ) ) {
function hide_profile_fields_with_css() {
?><style>
.user-rich-editing-wrap,
.user-syntax-highlighting-wrap,
.user-admin-color-wrap,
.user-comment-shortcuts-wrap,
.show-admin-bar,
.user-language-wrap,
.user-first-name-wrap,
.user-last-name-wrap,
.user-description-wrap,
.user-url-wrap {
display: none;
}</style>
<?php
}
add_action(
'admin_init',
function () {
add_action( 'admin_print_scripts-profile.php', 'hide_profile_fields_with_css' );
add_action( 'admin_print_scripts-user-edit.php', 'hide_profile_fields_with_css' );
}
);
}