X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/699231ae09f7057a4d0000cdf32e50a3df6a04ca..refs/heads/pristine:/wp-includes/ms-deprecated.php diff --git a/wp-includes/ms-deprecated.php b/wp-includes/ms-deprecated.php index b6073628..cd35f55c 100644 --- a/wp-includes/ms-deprecated.php +++ b/wp-includes/ms-deprecated.php @@ -14,13 +14,35 @@ */ /** - * @since unknown - * @deprecated 3.0.0 - * @deprecated Use wp_generate_password() + * Get the "dashboard blog", the blog where users without a blog edit their profile data. + * Dashboard blog functionality was removed in WordPress 3.1, replaced by the user admin. + * + * @since MU + * @deprecated 3.1.0 Use get_site() + * @see get_site() + * + * @return WP_Site Current site object. + */ +function get_dashboard_blog() { + _deprecated_function( __FUNCTION__, '3.1.0' ); + if ( $blog = get_site_option( 'dashboard_blog' ) ) { + return get_site( $blog ); + } + + return get_site( get_network()->site_id ); +} + +/** + * Generates a random password. + * + * @since MU + * @deprecated 3.0.0 Use wp_generate_password() * @see wp_generate_password() + * + * @param int $len Optional. The length of password to generate. Default 8. */ function generate_random_password( $len = 8 ) { - _deprecated_function( __FUNCTION__, '3.0', 'wp_generate_password()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'wp_generate_password()' ); return wp_generate_password( $len ); } @@ -34,24 +56,23 @@ function generate_random_password( $len = 8 ) { * legacy function_exists() checks to determine if multisite is enabled. * * @since MU - * @deprecated 3.0.0 - * @deprecated Use is_super_admin() + * @deprecated 3.0.0 Use is_super_admin() * @see is_super_admin() - * @see is_multisite() * + * @param string $user_login Optional. Username for the user to check. Default empty. */ function is_site_admin( $user_login = '' ) { - _deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'is_super_admin()' ); if ( empty( $user_login ) ) { $user_id = get_current_user_id(); if ( !$user_id ) return false; } else { - $user = new WP_User( null, $user_login) ; - if ( empty( $user->id ) ) + $user = get_user_by( 'login', $user_login ); + if ( ! $user->exists() ) return false; - $user_id = $user->id; + $user_id = $user->ID; } return is_super_admin( $user_id ); @@ -59,17 +80,18 @@ function is_site_admin( $user_login = '' ) { if ( !function_exists( 'graceful_fail' ) ) : /** + * Deprecated functionality to gracefully fail. + * * @since MU - * @deprecated 3.0.0 - * @deprecated Use wp_die() + * @deprecated 3.0.0 Use wp_die() * @see wp_die() */ function graceful_fail( $message ) { - _deprecated_function( __FUNCTION__, '3.0', 'wp_die()' ); + _deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' ); $message = apply_filters( 'graceful_fail', $message ); $message_template = apply_filters( 'graceful_fail_template', -' - +' + Error!