24
24
* @return int Current site ID.
26
26
function get_dashboard_blog() {
27
_deprecated_function( __FUNCTION__, '3.1' );
27
_deprecated_function( __FUNCTION__, '3.1.0' );
28
28
if ( $blog = get_site_option( 'dashboard_blog' ) )
29
29
return get_blog_details( $blog );
41
41
* @param int $len Optional. The length of password to generate. Default 8.
43
43
function generate_random_password( $len = 8 ) {
44
_deprecated_function( __FUNCTION__, '3.0', 'wp_generate_password()' );
44
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_generate_password()' );
45
45
return wp_generate_password( $len );
61
61
* @param string $user_login Optional. Username for the user to check. Default empty.
63
63
function is_site_admin( $user_login = '' ) {
64
_deprecated_function( __FUNCTION__, '3.0', 'is_super_admin()' );
64
_deprecated_function( __FUNCTION__, '3.0.0', 'is_super_admin()' );
66
66
if ( empty( $user_login ) ) {
67
67
$user_id = get_current_user_id();
88
88
function graceful_fail( $message ) {
89
_deprecated_function( __FUNCTION__, '3.0', 'wp_die()' );
89
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_die()' );
90
90
$message = apply_filters( 'graceful_fail', $message );
91
91
$message_template = apply_filters( 'graceful_fail_template',
126
126
* @param string $username Username.
128
128
function get_user_details( $username ) {
129
_deprecated_function( __FUNCTION__, '3.0', 'get_user_by()' );
129
_deprecated_function( __FUNCTION__, '3.0.0', 'get_user_by()' );
130
130
return get_user_by('login', $username);
140
140
* @param int $post_id Post ID.
142
142
function clear_global_post_cache( $post_id ) {
143
_deprecated_function( __FUNCTION__, '3.0', 'clean_post_cache()' );
143
_deprecated_function( __FUNCTION__, '3.0.0', 'clean_post_cache()' );
167
167
* @return string|bool Either false or the valid email address.
169
169
function validate_email( $email, $check_domain = true) {
170
_deprecated_function( __FUNCTION__, '3.0', 'is_email()' );
170
_deprecated_function( __FUNCTION__, '3.0.0', 'is_email()' );
171
171
return is_email( $email, $check_domain );
183
183
* @param string $deprecated Unused.
185
185
function get_blog_list( $start = 0, $num = 10, $deprecated = '' ) {
186
_deprecated_function( __FUNCTION__, '3.0', 'wp_get_sites()' );
186
_deprecated_function( __FUNCTION__, '3.0.0', 'wp_get_sites()' );
189
189
$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 );
216
216
* @return array List of "most active" sites.
218
218
function get_most_active_blogs( $num = 10, $display = true ) {
219
_deprecated_function( __FUNCTION__, '3.0' );
219
_deprecated_function( __FUNCTION__, '3.0.0' );
221
221
$blogs = get_blog_list( 0, 'all', false ); // $blog_id -> $details
222
222
if ( is_array( $blogs ) ) {
267
267
* @param string $url Optional. Redirect URL. Default empty.
269
269
function wpmu_admin_do_redirect( $url = '' ) {
270
_deprecated_function( __FUNCTION__, '3.3' );
270
_deprecated_function( __FUNCTION__, '3.3.0' );
273
273
if ( isset( $_GET['ref'] ) )
309
309
function wpmu_admin_redirect_add_updated_param( $url = '' ) {
310
_deprecated_function( __FUNCTION__, '3.3' );
310
_deprecated_function( __FUNCTION__, '3.3.0' );
312
312
if ( strpos( $url, 'updated=true' ) === false ) {
313
313
if ( strpos( $url, '?' ) === false )
334
334
function get_user_id_from_string( $string ) {
335
_deprecated_function( __FUNCTION__, '3.6', 'get_user_by()' );
335
_deprecated_function( __FUNCTION__, '3.6.0', 'get_user_by()' );
337
337
if ( is_email( $string ) )
338
338
$user = get_user_by( 'email', $string );
359
359
function get_blogaddress_by_domain( $domain, $path ) {
360
_deprecated_function( __FUNCTION__, '3.7' );
360
_deprecated_function( __FUNCTION__, '3.7.0' );
362
362
if ( is_subdomain_install() ) {
363
363
$url = "http://" . $domain.$path;
388
388
* @return string|int The ID of the newly created blog
390
390
function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) {
391
_deprecated_function( __FUNCTION__, '4.4' );
391
_deprecated_function( __FUNCTION__, '4.4.0' );
393
393
if ( empty($path) )
424
424
* @return array|false The network admins
426
426
function get_admin_users_for_domain( $sitedomain = '', $path = '' ) {
427
_deprecated_function( __FUNCTION__, '4.4' );
427
_deprecated_function( __FUNCTION__, '4.4.0' );
443
* Return an array of sites for a network or networks.
449
* @global wpdb $wpdb WordPress database abstraction object.
451
* @param array $args {
452
* Array of default arguments. Optional.
454
* @type int|array $network_id A network ID or array of network IDs. Set to null to retrieve sites
455
* from all networks. Defaults to current network ID.
456
* @type int $public Retrieve public or non-public sites. Default null, for any.
457
* @type int $archived Retrieve archived or non-archived sites. Default null, for any.
458
* @type int $mature Retrieve mature or non-mature sites. Default null, for any.
459
* @type int $spam Retrieve spam or non-spam sites. Default null, for any.
460
* @type int $deleted Retrieve deleted or non-deleted sites. Default null, for any.
461
* @type int $limit Number of sites to limit the query to. Default 100.
462
* @type int $offset Exclude the first x sites. Used in combination with the $limit parameter. Default 0.
464
* @return array An empty array if the install is considered "large" via wp_is_large_network(). Otherwise,
465
* an associative array of site data arrays, each containing the site (network) ID, blog ID,
466
* site domain and path, dates registered and modified, and the language ID. Also, boolean
467
* values for whether the site is public, archived, mature, spam, and/or deleted.
469
function wp_get_sites( $args = array() ) {
472
_deprecated_function( __FUNCTION__, '4.6.0', 'get_sites()' );
474
if ( wp_is_large_network() )
478
'network_id' => $wpdb->siteid,
488
$args = wp_parse_args( $args, $defaults );
490
// Backwards compatibility
491
if( is_array( $args['network_id'] ) ){
492
$args['network__in'] = $args['network_id'];
493
$args['network_id'] = null;
496
if( is_numeric( $args['limit'] ) ){
497
$args['number'] = $args['limit'];
498
$args['limit'] = null;
501
// Make sure count is disabled.
502
$args['count'] = false;
504
$_sites = get_sites( $args );
508
foreach ( $_sites as $_site ) {
509
$_site = get_site( $_site );
510
$results[] = $_site->to_array();