Filter hook 'show_password_fields'

in WP Core File wp-admin/user-edit.php at line 666

View Source

show_password_fields

Filter Hook
Description
Filters the display of the password fields.

Hook Information

File Location wp-admin/user-edit.php View on GitHub
Hook Type Filter
Line Number 666

Hook Parameters

Type Name Description
bool $show Whether to show the password fields. Default true.
WP_User $profile_user User object for the current user to edit.

Usage Examples

Basic Usage
<?php
// Hook into show_password_fields
add_filter('show_password_fields', 'my_custom_filter', 10, 2);

function my_custom_filter($show, $profile_user) {
    // Your custom filtering logic here
    return $show;
}

Source Code Context

wp-admin/user-edit.php:666 - How this hook is used in WordPress core
<?php
 661  					 * @since 4.4.0 Now evaluated only in user-edit.php.
 662  					 *
 663  					 * @param bool    $show         Whether to show the password fields. Default true.
 664  					 * @param WP_User $profile_user User object for the current user to edit.
 665  					 */
 666  					$show_password_fields = apply_filters( 'show_password_fields', true, $profile_user );
 667  					?>
 668  					<?php if ( $show_password_fields ) : ?>
 669  						</table>
 670  
 671  						<h2><?php _e( 'Account Management' ); ?></h2>

PHP Documentation

<?php
/**
					 * Filters the display of the password fields.
					 *
					 * @since 1.5.1
					 * @since 2.8.0 Added the `$profile_user` parameter.
					 * @since 4.4.0 Now evaluated only in user-edit.php.
					 *
					 * @param bool    $show         Whether to show the password fields. Default true.
					 * @param WP_User $profile_user User object for the current user to edit.
					 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-admin/user-edit.php
Related Hooks

Related hooks will be displayed here in future updates.