From 54eb8900dd82ff92eb134278541364cbaae4ec6a Mon Sep 17 00:00:00 2001 From: flixos90 Date: Mon, 3 Apr 2017 23:43:00 +0000 Subject: [PATCH] Multisite: Fix `wp_get_sites()` to return an unlimited amount of sites when passing a falsy `limit` argument. Props iandunn for the original patch. Fixes #39879. See #35791. git-svn-id: https://develop.svn.wordpress.org/trunk@40372 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-deprecated.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php index cd35f55c63..3d06dab9fb 100644 --- a/src/wp-includes/ms-deprecated.php +++ b/src/wp-includes/ms-deprecated.php @@ -497,6 +497,9 @@ function wp_get_sites( $args = array() ) { 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.