WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/06/2015 04:34:03 AM (4 years ago)
Author:
DrewAPicture
Message:

Multisite: Introduce get_subdirectory_reserved_names(), which returns a filterable list of reserved subdirectory site names.

The function encapsulates the existing subdirectory_reserved_names filter and reduces the maintenance burden of keeping the value of (currently) two instances of the same hook in sync.

See #33615.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r34850 r34854  
    4747    // If not a subdomain install, make sure the domain isn't a reserved word
    4848    if ( ! is_subdomain_install() ) {
    49         /** This filter is documented in wp-includes/ms-functions.php */
    50         $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'embed', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json' ) );
    51         if ( in_array( $domain, $subdirectory_reserved_names ) )
    52             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 ) ) );
     49        $subdirectory_reserved_names = get_subdirectory_reserved_names();
     50
     51        if ( in_array( $domain, $subdirectory_reserved_names ) ) {
     52            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 ) ) );
     53        }
    5354    }
    5455
Note: See TracChangeset for help on using the changeset viewer.