show_password_fields
Filters the display of the password fields.
Использование
add_filter( 'show_password_fields', 'wp_kama_show_password_fields_filter', 10, 2 );
/**
* Function for `show_password_fields` filter-hook.
*
* @param bool $show Whether to show the password fields.
* @param WP_User $profile_user User object for the current user to edit.
*
* @return bool
*/
function wp_kama_show_password_fields_filter( $show, $profile_user ){
// filter...
return $show;
}
- $show(true|false)
- Whether to show the password fields.
По умолчанию: true - $profile_user(WP_User)
- User object for the current user to edit.
Список изменений
| С версии 1.5.1 | Введена. |
| С версии 2.8.0 | Added the $profile_user parameter. |
| С версии 4.4.0 | Now evaluated only in user-edit.php. |
Где вызывается хук
В файле: /wp-admin/user-edit.php
show_password_fields
wp-admin/user-edit.php 680
$show_password_fields = apply_filters( 'show_password_fields', true, $profile_user );