X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/4713a14935b83517997f3c88f808eb41da55033d..caeaf8dc94b5e3f75dc98ec92dc7b76049cdddb6:/wp-includes/ms-functions.php?ds=sidebyside diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 431ba070..5537fb36 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -11,8 +11,6 @@ * Gets the network's site and user counts. * * @since MU 1.0 - * @uses get_blog_count() - * @uses get_user_count() * * @return array Site and user count for the network. */ @@ -58,9 +56,6 @@ function get_admin_users_for_domain( $sitedomain = '', $path = '' ) { * is returned. * * @since MU 1.0 - * @uses get_blogs_of_user() - * @uses add_user_to_blog() - * @uses get_blog_details() * * @param int $user_id The unique ID of the user * @return object The blog object @@ -298,7 +293,6 @@ function remove_user_from_blog($user_id, $blog_id = '', $reassign = '') { * Create an empty blog. * * @since MU 1.0 - * @uses install_blog() * * @param string $domain The new blog's domain. * @param string $path The new blog's path. @@ -455,9 +449,6 @@ function is_email_address_unsafe( $user_email ) { * relevant errors if necessary. * * @since MU - * @uses is_email_address_unsafe() - * @uses username_exists() - * @uses email_exists() * * @param string $user_name The login name provided by the user. * @param string $user_email The email provided by the user. @@ -580,8 +571,6 @@ function wpmu_validate_user_signup($user_name, $user_email) { * the way that WordPress validates new site signups. * * @since MU - * @uses domain_exists() - * @uses username_exists() * * @param string $blogname The blog name provided by the user. Must be unique. * @param string $blog_title The blog title provided by the user. @@ -713,7 +702,6 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { * Record site signup information for future activation. * * @since MU - * @uses wpmu_signup_blog_notification() * * @param string $domain The requested domain. * @param string $path The requested path. @@ -749,7 +737,6 @@ function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = a * new site registration is not. * * @since MU - * @uses wpmu_signup_user_notification() * * @param string $user The user's requested login name. * @param string $user_email The user's email address. @@ -978,12 +965,6 @@ function wpmu_signup_user_notification( $user, $user_email, $key, $meta = array( * by a Super Admin). * * @since MU - * @uses wp_generate_password() - * @uses wpmu_welcome_user_notification() - * @uses add_user_to_blog() - * @uses wpmu_create_user() - * @uses wpmu_create_blog() - * @uses wpmu_welcome_notification() * * @param string $key The activation key provided to the user. * @return array An array containing information about the activated user and/or blog @@ -1078,12 +1059,11 @@ function wpmu_activate_signup($key) { * use 'user_register'). * * @since MU - * @uses wp_create_user() * * @param string $user_name The new user's login name. * @param string $password The new user's password. * @param string $email The new user's email address. - * @return mixed Returns false on failure, or int $user_id on success + * @return int|bool Returns false on failure, or int $user_id on success */ function wpmu_create_user( $user_name, $password, $email ) { $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); @@ -1121,10 +1101,6 @@ function wpmu_create_user( $user_name, $password, $email ) { * root domain (eg 'blog1.example.com'), and $path is '/'. * * @since MU - * @uses domain_exists() - * @uses insert_blog() - * @uses wp_install_defaults() - * @uses add_user_to_blog() * * @param string $domain The new site's domain. * @param string $path The new site's path. @@ -1248,7 +1224,6 @@ Disable these notifications: %4$s' ), $blogname, $siteurl, wp_unslash( $_SERVER[ * the notification email. * * @since MU - * @uses apply_filters() Filter newuser_notify_siteadmin to change the content of the email message * * @param int $user_id The new user's ID. * @return bool @@ -1354,8 +1329,6 @@ function insert_blog($domain, $path, $site_id) { * points to the new blog. * * @since MU - * @uses make_db_current_silent() - * @uses populate_roles() * * @param int $blog_id The value returned by insert_blog(). * @param string $blog_title The title of the new site. @@ -1379,7 +1352,9 @@ function install_blog( $blog_id, $blog_title = '' ) { make_db_current_silent( 'blog' ); populate_options(); populate_roles(); - $wp_roles->_init(); + + // populate_roles() clears previous role definitions so we start over. + $wp_roles = new WP_Roles(); $url = untrailingslashit( $url ); @@ -1408,7 +1383,6 @@ function install_blog( $blog_id, $blog_title = '' ) { * @since MU * @deprecated MU * @deprecated Use wp_install_defaults() - * @uses wp_install_defaults() * * @param int $blog_id Ignored in this function. * @param int $user_id @@ -1469,6 +1443,7 @@ Your new SITE_NAME site has been successfully set up at: BLOG_URL You can log in to the administrator account with the following information: + Username: USERNAME Password: PASSWORD Log in here: BLOG_URLwp-login.php @@ -1627,7 +1602,6 @@ function get_current_site() { * the most recent post_date_gmt. * * @since MU - * @uses get_blogs_of_user() * * @param int $user_id * @return array Contains the blog_id, post_id, post_date_gmt, and post_gmt_ts @@ -1674,7 +1648,6 @@ function get_most_recent_post_of_user( $user_id ) { * a blog has exceeded its allowed upload space. * * @since MU - * @uses recurse_dirsize() * * @param string $directory * @return int @@ -1745,7 +1718,8 @@ function recurse_dirsize( $directory ) { * @return array */ function check_upload_mimes( $mimes ) { - $site_exts = explode( ' ', get_site_option( 'upload_filetypes' ) ); + $site_exts = explode( ' ', get_site_option( 'upload_filetypes', 'jpg jpeg png gif' ) ); + $site_mimes = array(); foreach ( $site_exts as $ext ) { foreach ( $mimes as $ext_pattern => $mime ) { if ( $ext != '' && strpos( $ext_pattern, $ext ) !== false ) @@ -1761,7 +1735,7 @@ function check_upload_mimes( $mimes ) { * WordPress MS stores a blog's post count as an option so as * to avoid extraneous COUNTs when a blog's details are fetched * with get_blog_details(). This function is called when posts - * are published to make sure the count stays current. + * are published or unpublished to make sure the count stays current. * * @since MU */ @@ -1887,7 +1861,6 @@ function upload_is_file_too_big( $upload ) { * Add a nonce field to the signup page. * * @since MU - * @uses wp_nonce_field() */ function signup_nonce_fields() { $id = mt_rand(); @@ -1899,7 +1872,6 @@ function signup_nonce_fields() { * Process the signup nonce created in signup_nonce_fields(). * * @since MU - * @uses wp_create_nonce() * * @param array $result * @return array @@ -1945,7 +1917,6 @@ function maybe_redirect_404() { * added, as when a user is invited through the regular WP Add User interface. * * @since MU - * @uses add_existing_user_to_blog() */ function maybe_add_existing_user_to_blog() { if ( false === strpos( $_SERVER[ 'REQUEST_URI' ], '/newbloguser/' ) ) @@ -1971,7 +1942,6 @@ function maybe_add_existing_user_to_blog() { * Add a user to a blog based on details from maybe_add_existing_user_to_blog(). * * @since MU - * @uses add_user_to_blog() * * @param array $details */ @@ -2029,7 +1999,6 @@ function fix_phpmailer_messageid( $phpmailer ) { * Check to see whether a user is marked as a spammer, based on user login. * * @since MU - * @uses get_user_by() * * @param string|WP_User $user Optional. Defaults to current user. WP_User object, * or user login name as a string. @@ -2052,11 +2021,9 @@ function is_user_spammy( $user = null ) { * Public blogs have a setting of 1, private blogs are 0. * * @since MU - * @uses update_blog_status() * * @param int $old_value * @param int $value The new public value - * @return bool */ function update_blog_public( $old_value, $value ) { update_blog_status( get_current_blog_id(), 'public', (int) $value ); @@ -2067,7 +2034,6 @@ add_action('update_option_blog_public', 'update_blog_public', 10, 2); * Check whether a usermeta key has to do with the current blog. * * @since MU - * @uses wp_get_current_user() * * @param string $key * @param int $user_id Optional. Defaults to current user. @@ -2078,11 +2044,9 @@ function is_user_option_local( $key, $user_id = 0, $blog_id = 0 ) { global $wpdb; $current_user = wp_get_current_user(); - if ( $user_id == 0 ) - $user_id = $current_user->ID; - if ( $blog_id == 0 ) + if ( $blog_id == 0 ) { $blog_id = $wpdb->blogid; - + } $local_key = $wpdb->get_blog_prefix( $blog_id ) . $key; if ( isset( $current_user->$local_key ) ) @@ -2206,8 +2170,6 @@ function wp_update_network_counts() { * on a network when a site is created or its status is updated. * * @since 3.7.0 - * - * @uses wp_update_network_site_counts() */ function wp_maybe_update_network_site_counts() { $is_small_network = ! wp_is_large_network( 'sites' ); @@ -2235,8 +2197,6 @@ function wp_maybe_update_network_site_counts() { * on a network when a user is created or its status is updated. * * @since 3.7.0 - * - * @uses wp_update_network_user_counts() */ function wp_maybe_update_network_user_counts() { $is_small_network = ! wp_is_large_network( 'users' );