-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathusers.php
More file actions
98 lines (86 loc) · 2.15 KB
/
users.php
File metadata and controls
98 lines (86 loc) · 2.15 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<?php
/**
* Remove social contact methods
*/
// Remove all
add_filter( 'user_contactmethods', '__return_empty_array' );
// Or remove specific ones
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;
}
);
/**
* 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' );
add_action( 'admin_print_scripts-user-new.php', 'hide_profile_fields_with_css' );
}
);
}
/**
* Hide reset password function in users table
*/
add_action(
'admin_init',
function () {
add_action(
'admin_print_scripts-users.php',
function () {
?>
<style>
.row-actions .resetpassword {
display: none;
}
</style>
<?php
}
);
}
);