#32928 closed enhancement (duplicate)
Multisite: Allow the developer to filter the domain validation regex from /wp-admin/network/site-new.php line #41 (WP 4.2.2)
Reported by: | lordspace | Owned by: | |
---|---|---|---|
Milestone: | Priority: | normal | |
Severity: | normal | Version: | |
Component: | Networks and Sites | Keywords: | |
Focuses: | multisite | Cc: |
Description
I am working on a project that may have sites that are nested within another path for example:
/faculty/
/faculty/sub-site/
/faculty/sub-site2/
etc.
Fix:
$ms_domain_validation_regex = apply_filters( 'ms_domain_validation_regex', '|^([a-zA-Z0-9-])+$|' ); if ( preg_match( $ms_domain_validation_regex, $blog['domain'] ) ) { $domain = strtolower( $blog['domain'] ); }
old:
if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) $domain = strtolower( $blog['domain'] );
Feel free to come up with a better name for the filter.
Related:
https://make.wordpress.org/core/2013/10/06/potential-roadmap-for-multisite/
http://www.paulund.co.uk/wordpress-multisite-nested-paths
Change History (4)
Note: See
TracTickets for help on using
tickets.
Hi @lordspace, thanks for the ticket! This looks like a duplicate of #18777. I agree that we should be able to do something to make this easier. There are a few places where general domain and path validation should be improved.