wp/wp-includes/ms-deprecated.php
changeset 5 5e2f62d02dcd
parent 0 d970ebf37754
child 7 cf61fcea0001
equal deleted inserted replaced
4:346c88efed21 5:5e2f62d02dcd
    84 function graceful_fail( $message ) {
    84 function graceful_fail( $message ) {
    85 	_deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
    85 	_deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
    86 	$message = apply_filters( 'graceful_fail', $message );
    86 	$message = apply_filters( 'graceful_fail', $message );
    87 	$message_template = apply_filters( 'graceful_fail_template',
    87 	$message_template = apply_filters( 'graceful_fail_template',
    88 '<!DOCTYPE html>
    88 '<!DOCTYPE html>
    89 <html xmlns="http://www.w3.org/1999/xhtml"><head profile="http://gmpg.org/xfn/11">
    89 <html xmlns="http://www.w3.org/1999/xhtml"><head>
    90 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    90 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    91 <title>Error!</title>
    91 <title>Error!</title>
    92 <style type="text/css">
    92 <style type="text/css">
    93 img {
    93 img {
    94 	border: 0;
    94 	border: 0;
   164 	_deprecated_function( __FUNCTION__, '3.0', 'wp_get_sites()' );
   164 	_deprecated_function( __FUNCTION__, '3.0', 'wp_get_sites()' );
   165 
   165 
   166 	global $wpdb;
   166 	global $wpdb;
   167 	$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
   167 	$blogs = $wpdb->get_results( $wpdb->prepare("SELECT blog_id, domain, path FROM $wpdb->blogs WHERE site_id = %d AND public = '1' AND archived = '0' AND mature = '0' AND spam = '0' AND deleted = '0' ORDER BY registered DESC", $wpdb->siteid), ARRAY_A );
   168 
   168 
       
   169 	$blog_list = array();
   169 	foreach ( (array) $blogs as $details ) {
   170 	foreach ( (array) $blogs as $details ) {
   170 		$blog_list[ $details['blog_id'] ] = $details;
   171 		$blog_list[ $details['blog_id'] ] = $details;
   171 		$blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" );
   172 		$blog_list[ $details['blog_id'] ]['postcount'] = $wpdb->get_var( "SELECT COUNT(ID) FROM " . $wpdb->get_blog_prefix( $details['blog_id'] ). "posts WHERE post_status='publish' AND post_type='post'" );
   172 	}
   173 	}
   173 	unset( $blogs );
   174 
   174 	$blogs = $blog_list;
   175 	if ( ! $blog_list ) {
   175 
       
   176 	if ( false == is_array( $blogs ) )
       
   177 		return array();
   176 		return array();
   178 
   177 	}
   179 	if ( $num == 'all' )
   178 
   180 		return array_slice( $blogs, $start, count( $blogs ) );
   179 	if ( $num == 'all' ) {
   181 	else
   180 		return array_slice( $blog_list, $start, count( $blog_list ) );
   182 		return array_slice( $blogs, $start, $num );
   181 	} else {
       
   182 		return array_slice( $blog_list, $start, $num );
       
   183 	}
   183 }
   184 }
   184 
   185 
   185 /**
   186 /**
   186  * @since MU
   187  * @since MU
   187  * @deprecated 3.0.0
   188  * @deprecated 3.0.0
   191 	_deprecated_function( __FUNCTION__, '3.0' );
   192 	_deprecated_function( __FUNCTION__, '3.0' );
   192 
   193 
   193 	$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
   194 	$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
   194 	if ( is_array( $blogs ) ) {
   195 	if ( is_array( $blogs ) ) {
   195 		reset( $blogs );
   196 		reset( $blogs );
       
   197 		$most_active = array();
       
   198 		$blog_list = array();
   196 		foreach ( (array) $blogs as $key => $details ) {
   199 		foreach ( (array) $blogs as $key => $details ) {
   197 			$most_active[ $details['blog_id'] ] = $details['postcount'];
   200 			$most_active[ $details['blog_id'] ] = $details['postcount'];
   198 			$blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!!
   201 			$blog_list[ $details['blog_id'] ] = $details; // array_slice() removes keys!!
   199 		}
   202 		}
   200 		arsort( $most_active );
   203 		arsort( $most_active );
   201 		reset( $most_active );
   204 		reset( $most_active );
   202 		foreach ( (array) $most_active as $key => $details )
   205 		$t = array();
       
   206 		foreach ( (array) $most_active as $key => $details ) {
   203 			$t[ $key ] = $blog_list[ $key ];
   207 			$t[ $key ] = $blog_list[ $key ];
   204 
   208 		}
   205 		unset( $most_active );
   209 		unset( $most_active );
   206 		$most_active = $t;
   210 		$most_active = $t;
   207 	}
   211 	}
   208 
   212 
   209 	if ( $display == true ) {
   213 	if ( $display == true ) {
   230  * 6) $url
   234  * 6) $url
   231  *
   235  *
   232  * @since MU
   236  * @since MU
   233  * @deprecated 3.3.0
   237  * @deprecated 3.3.0
   234  * @deprecated Use wp_redirect()
   238  * @deprecated Use wp_redirect()
   235  * @uses wpmu_admin_redirect_add_updated_param()
       
   236  *
   239  *
   237  * @param string $url
   240  * @param string $url
   238  */
   241  */
   239 function wpmu_admin_do_redirect( $url = '' ) {
   242 function wpmu_admin_do_redirect( $url = '' ) {
   240 	_deprecated_function( __FUNCTION__, '3.3' );
   243 	_deprecated_function( __FUNCTION__, '3.3' );
   295  * and is simply returned as such.
   298  * and is simply returned as such.
   296  *
   299  *
   297  * @since MU
   300  * @since MU
   298  * @deprecated 3.6.0
   301  * @deprecated 3.6.0
   299  * @deprecated Use get_user_by()
   302  * @deprecated Use get_user_by()
   300  * @uses get_user_by()
       
   301  *
   303  *
   302  * @param string $string Either an email address or a login.
   304  * @param string $string Either an email address or a login.
   303  * @return int
   305  * @return int
   304  */
   306  */
   305 function get_user_id_from_string( $string ) {
   307 function get_user_id_from_string( $string ) {