Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: subdirectory_reserved_names

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
38
39      $blog = $_POST['blog'];
40      $domain = '';
41      if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
42           $domain = strtolower( $blog['domain'] );
43
44      // If not a subdomain install, make sure the domain isn't a reserved word
45      if ( ! is_subdomain_install() ) {
46           /** This filter is documented in wp-includes/ms-functions.php */
47           $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
48           if ( in_array( $domain, $subdirectory_reserved_names ) )
49                wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
50      }
51
52      $title = $blog['title'];
53
54      if ( empty( $domain ) )
55           wp_die( __( 'Missing or invalid site address.' ) );
56