minimum_site_name_length
Filter HookDescription
Filters the minimum site name length required when validating a site signup.Hook Information
File Location |
wp-includes/ms-functions.php
View on GitHub
|
Hook Type | Filter |
Line Number | 681 |
Hook Parameters
Type | Name | Description |
---|---|---|
int
|
$length
|
The minimum site name length. Default 4. |
Usage Examples
Basic Usage
<?php
// Hook into minimum_site_name_length
add_filter('minimum_site_name_length', 'my_custom_filter', 10, 1);
function my_custom_filter($length) {
// Your custom filtering logic here
return $length;
}
Source Code Context
wp-includes/ms-functions.php:681
- How this hook is used in WordPress core
<?php
676 *
677 * @since 4.8.0
678 *
679 * @param int $length The minimum site name length. Default 4.
680 */
681 $minimum_site_name_length = apply_filters( 'minimum_site_name_length', 4 );
682
683 if ( strlen( $blogname ) < $minimum_site_name_length ) {
684 /* translators: %s: Minimum site name length. */
685 $errors->add( 'blogname', sprintf( _n( 'Site name must be at least %s character.', 'Site name must be at least %s characters.', $minimum_site_name_length ), number_format_i18n( $minimum_site_name_length ) ) );
686 }
PHP Documentation
<?php
/**
* Filters the minimum site name length required when validating a site signup.
*
* @since 4.8.0
*
* @param int $length The minimum site name length. Default 4.
*/
Quick Info
- Hook Type: Filter
- Parameters: 1
- File: wp-includes/ms-functions.php
Related Hooks
Related hooks will be displayed here in future updates.