Filter hook 'user_{$name}_label'

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

View Source

user_{$name}_label

Filter Hook
Description
Filters a user contactmethod label. The dynamic portion of the hook name, `$name`, refers to each of the keys in the contact methods array.

Hook Information

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

Hook Parameters

Type Name Description
string $desc The translatable label for the contact method.

Usage Examples

Basic Usage
<?php
// Hook into user_{$name}_label
add_filter('user_{$name}_label', 'my_custom_filter', 10, 1);

function my_custom_filter($desc) {
    // Your custom filtering logic here
    return $desc;
}

Source Code Context

wp-admin/user-edit.php:602 - How this hook is used in WordPress core
<?php
 597  							 *
 598  							 * @since 2.9.0
 599  							 *
 600  							 * @param string $desc The translatable label for the contact method.
 601  							 */
 602  							echo apply_filters( "user_{$name}_label", $desc );
 603  							?>
 604  							</label>
 605  						</th>
 606  						<td>
 607  							<input type="text" name="<?php echo $name; ?>" id="<?php echo $name; ?>" value="<?php echo esc_attr( $profile_user->$name ); ?>" class="regular-text" />

PHP Documentation

<?php
/**
							 * Filters a user contactmethod label.
							 *
							 * The dynamic portion of the hook name, `$name`, refers to
							 * each of the keys in the contact methods array.
							 *
							 * @since 2.9.0
							 *
							 * @param string $desc The translatable label for the contact method.
							 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-admin/user-edit.php
Related Hooks

Related hooks will be displayed here in future updates.