Changeset 34854
- Timestamp:
- 10/06/2015 04:34:03 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/site-new.php
r34850 r34854 47 47 // If not a subdomain install, make sure the domain isn't a reserved word 48 48 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 } 53 54 } 54 55 -
trunk/src/wp-includes/ms-functions.php
r34853 r34854 556 556 */ 557 557 if ( ! is_subdomain_install() ) { 558 $illegal_names = array_merge( 559 $illegal_names, 560 /** 561 * Filter reserved site names on a sub-directory Multisite install. 562 * 563 * @since 3.0.0 564 * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added 565 * to the reserved names list. 566 * 567 * @param array $subdirectory_reserved_names Array of reserved names. 568 */ 569 apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', 'embed' ) ) 570 ); 558 $illegal_names = array_merge( $illegal_names, get_subdirectory_reserved_names() ); 571 559 } 572 560 … … 2469 2457 return $site_results; 2470 2458 } 2459 2460 /** 2461 * Retrieves a list of reserved site on a sub-directory Multisite install. 2462 * 2463 * @since 4.4.0 2464 * 2465 * @return array $names Array of reserved subdirectory names. 2466 */ 2467 function get_subdirectory_reserved_names() { 2468 $names = array( 2469 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 2470 'wp-content', 'wp-includes', 'wp-json', 'embed' 2471 ); 2472 2473 /** 2474 * Filter reserved site names on a sub-directory Multisite install. 2475 * 2476 * @since 3.0.0 2477 * @since 4.4.0 'wp-admin', 'wp-content', 'wp-includes', 'wp-json', and 'embed' were added 2478 * to the reserved names list. 2479 * 2480 * @param array $subdirectory_reserved_names Array of reserved names. 2481 */ 2482 return apply_filters( 'subdirectory_reserved_names', $names ); 2483 }
Note: See TracChangeset
for help on using the changeset viewer.