pre_user_url
Filter HookDescription
Filters a user's URL before the user is created or updated.Hook Information
File Location |
wp-includes/user.php
View on GitHub
|
Hook Type | Filter |
Line Number | 2333 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$raw_user_url
|
The user's URL. |
Usage Examples
Basic Usage
<?php
// Hook into pre_user_url
add_filter('pre_user_url', 'my_custom_filter', 10, 1);
function my_custom_filter($raw_user_url) {
// Your custom filtering logic here
return $raw_user_url;
}
Source Code Context
wp-includes/user.php:2333
- How this hook is used in WordPress core
<?php
2328 *
2329 * @since 2.0.3
2330 *
2331 * @param string $raw_user_url The user's URL.
2332 */
2333 $user_url = apply_filters( 'pre_user_url', $raw_user_url );
2334
2335 if ( mb_strlen( $user_url ) > 100 ) {
2336 return new WP_Error( 'user_url_too_long', __( 'User URL may not be longer than 100 characters.' ) );
2337 }
2338
PHP Documentation
<?php
/**
* Filters a user's URL before the user is created or updated.
*
* @since 2.0.3
*
* @param string $raw_user_url The user's URL.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/user.php
Related Hooks
Related hooks will be displayed here in future updates.