wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren
wp_get_sites is deprecated since version 4.6.0!
Alternative: get_sites()
Alternative: get_sites()
wp_get_sites › WordPress Function
Seit3.7.0
Veraltet4.6.0
› wp_get_sites ( $args = array() )
Parameter: |
|
Siehe: | |
Gibt zurück: |
|
Definiert in: |
|
Codex: |
Return an array of sites for a network or networks.
Quellcode
function wp_get_sites( $args = array() ) { _deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' ); if ( wp_is_large_network() ) return array(); $defaults = array( 'network_id' => get_current_network_id(), 'public' => null, 'archived' => null, 'mature' => null, 'spam' => null, 'deleted' => null, 'limit' => 100, 'offset' => 0, ); $args = wp_parse_args( $args, $defaults ); // Backward compatibility. if( is_array( $args['network_id'] ) ){ $args['network__in'] = $args['network_id']; $args['network_id'] = null; } if( is_numeric( $args['limit'] ) ){ $args['number'] = $args['limit']; $args['limit'] = null; } elseif ( ! $args['limit'] ) { $args['number'] = 0; $args['limit'] = null; } // Make sure count is disabled. $args['count'] = false; $_sites = get_sites( $args ); $results = array(); foreach ( $_sites as $_site ) { $_site = get_site( $_site ); $results[] = $_site->to_array(); } return $results; }