---
 src/wp-includes/cron.php     | 15 ++++++++++-----
 tests/phpunit/tests/cron.php | 26 ++++++++++++++++++++++++++
 2 files changed, 36 insertions(+), 5 deletions(-)

diff --git a/src/wp-includes/cron.php b/src/wp-includes/cron.php
index 493e0ec..dfd05d5 100644
--- a/src/wp-includes/cron.php
+++ b/src/wp-includes/cron.php
@@ -214,19 +214,24 @@ function wp_clear_scheduled_hook( $hook, $args = array() ) {
  * Retrieve the next timestamp for a cron event.
  *
  * @since 2.1.0
+ * @since 4.5.0 The `$ignore_args` parameter was added.
  *
- * @param string $hook Action hook to execute when cron is run.
- * @param array $args Optional. Arguments to pass to the hook's callback function.
+ * @param string      $hook        Action hook to execute when cron is run.
+ * @param array|false $args        Optional. Arguments to pass to the hook's callback function.
+ * @param bool        $ignore_args Optional. Whether to check for any event scheduled on the action hook
+ *                                 independently of arguments. Defaults to false.
  * @return false|int The UNIX timestamp of the next time the scheduled event will occur.
  */
-function wp_next_scheduled( $hook, $args = array() ) {
+function wp_next_scheduled( $hook, $args = array(), $ignore_args = false ) {
 	$crons = _get_cron_array();
 	$key = md5(serialize($args));
-	if ( empty($crons) )
+	if ( empty($crons) ) {
 		return false;
+	}
 	foreach ( $crons as $timestamp => $cron ) {
-		if ( isset( $cron[$hook][$key] ) )
+		if ( true === $ignore_args && isset( $cron[ $hook ] ) || isset( $cron[ $hook ][ $key ] ) ) {
 			return $timestamp;
+		}
 	}
 	return false;
 }
diff --git a/tests/phpunit/tests/cron.php b/tests/phpunit/tests/cron.php
index b411a5b..59a16c7 100644
--- a/tests/phpunit/tests/cron.php
+++ b/tests/phpunit/tests/cron.php
@@ -85,6 +85,32 @@ class Tests_Cron extends WP_UnitTestCase {
 
 	}
 
+	/**
+	 * @ticket 35491
+	 */
+	function test_wp_next_scheduled_no_args() {
+		$hook = rand_str();
+		$ts1 = strtotime( '+30 minutes' );
+		$ts2 = strtotime( '+2 hours' );
+
+		$this->assertFalse( wp_next_scheduled( $hook, null, true ) );
+
+		wp_schedule_event( $ts1, 'hourly', $hook, array( 'foo' ) );
+		wp_schedule_event( $ts2, 'daily', $hook, array( 'bar' ) );
+		wp_schedule_event( $ts2, 'twicedaily', $hook, array( 'baz' ) );
+
+		$this->assertSame( $ts1, wp_next_scheduled( $hook, null, true ) );
+
+		wp_unschedule_event( $ts1, $hook, array( 'foo' ) );
+		$this->assertSame( $ts2, wp_next_scheduled( $hook, null, true ) );
+
+		wp_unschedule_event( $ts2, $hook, array( 'bar' ) );
+		$this->assertSame( $ts2, wp_next_scheduled( $hook, null, true  ) );
+
+		wp_unschedule_event( $ts2, $hook, array( 'baz' ) );
+		$this->assertFalse( wp_next_scheduled( $hook, null, true ) );
+	}
+
 	function test_unschedule_event() {
 		// schedule an event and make sure it's returned by wp_next_scheduled
 		$hook = rand_str();
-- 
1.9.4.msysgit.2

