Filter hook 'subdirectory_reserved_names'

in WP Core File wp-includes/ms-functions.php at line 2768

View Source

subdirectory_reserved_names

Filter Hook
Description
Filters reserved site names on a sub-directory Multisite installation. to the reserved names list.

Hook Information

File Location wp-includes/ms-functions.php View on GitHub
Hook Type Filter
Line Number 2768

Hook Parameters

Type Name Description
string[] $subdirectory_reserved_names Array of reserved names.

Usage Examples

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

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

Source Code Context

wp-includes/ms-functions.php:2768 - How this hook is used in WordPress core
<?php
2763  	 * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added
2764  	 *              to the reserved names list.
2765  	 *
2766  	 * @param string[] $subdirectory_reserved_names Array of reserved names.
2767  	 */
2768  	return apply_filters( 'subdirectory_reserved_names', $names );
2769  }
2770  
2771  /**
2772   * Sends a confirmation request email when a change of network admin email address is attempted.
2773   *

PHP Documentation

<?php
/**
	 * Filters reserved site names on a sub-directory Multisite installation.
	 *
	 * @since 3.0.0
	 * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added
	 *              to the reserved names list.
	 *
	 * @param string[] $subdirectory_reserved_names Array of reserved names.
	 */
Quick Info
  • Hook Type: Filter
  • Parameters: 1
  • File: wp-includes/ms-functions.php
Related Hooks

Related hooks will be displayed here in future updates.