Changes between Initial Version and Version 1 of Ticket #40064, comment 5
- Timestamp:
- 03/09/2017 05:08:18 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #40064, comment 5
initial v1 2 2 3 3 {{{#!php 4 <?php 5 4 6 function get_blog_details( $fields = null, $get_all = true ) { 5 7 $args = array(); … … 20 22 } 21 23 24 } elseif ( is_numeric( $fields ) ){ 25 $args['site__in'][] = $fields; 26 } elseif ( $fields && is_string( $fields ) ) { 27 $current_network = get_network(); 28 $slug = trim( $fields, '/' ); 29 30 if ( is_subdomain_install() ) { 31 $domain = $slug . '.' . preg_replace( '|^www\.|', '', $current_network->domain ); 32 $path = $current_network->path; 33 } else { 34 $domain = $current_network->domain; 35 $path = $current_network->path . $slug . '/'; 36 } 37 $args['path'] = $path; 38 $args['domain'] = $domain; 22 39 } else { 23 if ( ! $fields ){ 24 $args['site__in'][] = get_current_blog_id(); 25 } elseif ( ! is_numeric( $fields ) ){ 26 $args['site__in'][] = get_id_from_blogname( $fields ); 27 } else { 28 $args['site__in'][] = $fields; 29 } 30 } 40 $args['site__in'][] = get_current_blog_id(); 41 } 31 42 32 43 if( empty( $args ) ){ … … 51 62 $details->home = get_option( 'home' ); 52 63 restore_current_blog(); 53 }64 54 65 /** 55 66 * Filters a blog's details. … … 61 72 */ 62 73 $details = apply_filters_deprecated( 'blog_details', array( $details ), '4.7.0', 'site_details' ); 63 74 } 64 75 return $details; 65 76 }