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 |
---|---|
39 | if ( ! is_array( $_POST['blog'] ) ) |
40 | wp_die( __( 'Can’t create an empty site.' ) ); |
41 | $blog = $_POST['blog']; |
42 | $domain = ''; |
43 | if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) |
44 | $domain = strtolower( $blog['domain'] ); |
45 |
|
46 | // If not a subdomain install, make sure the domain isn't a reserved word |
47 | if ( ! is_subdomain_install() ) { |
48 | $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ); |
49 | if ( in_array( $domain, $subdirectory_reserved_names ) ) |
50 | 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 ) ) ); |
51 | } |
52 |
|
53 | $email = sanitize_email( $blog['email'] ); |
54 | $title = $blog['title']; |
55 |
|
56 | if ( empty( $domain ) ) |
57 | wp_die( __( 'Missing or invalid site address.' ) ); |