WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
145 | if ( is_array( $_POST['blog'] ) == false ) |
146 | wp_die( __( 'Can’t create an empty site.' ) ); |
147 | $blog = $_POST['blog']; |
148 | $domain = ''; |
149 | if ( ! preg_match( '/(--)/', $blog['domain'] ) && preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) |
150 | $domain = strtolower( $blog['domain'] ); |
151 |
|
152 | // If not a subdomain install, make sure the domain isn't a reserved word |
153 | if ( ! is_subdomain_install() ) { |
154 | $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ); |
155 | if ( in_array( $domain, $subdirectory_reserved_names ) ) |
156 | 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 ) ) ); |
157 | } |
158 |
|
159 | $email = sanitize_email( $blog['email'] ); |
160 | $title = $blog['title']; |
161 |
|
162 | if ( empty( $domain ) ) |
163 | wp_die( __( 'Missing or invalid site address.' ) ); |