diff --git a/src/wp-includes/class-wp-hook.php b/src/wp-includes/class-wp-hook.php
index 823b4b5..2fba490 100755
--- a/src/wp-includes/class-wp-hook.php
+++ b/src/wp-includes/class-wp-hook.php
@@ -287,18 +287,20 @@ final class WP_Hook implements Iterator, ArrayAccess {
 			$this->current_priority[ $nesting_level ] = $priority = current( $this->iterations[ $nesting_level ] );
 
 			foreach ( $this->callbacks[ $priority ] as $the_ ) {
-				if( ! $this->doing_action ) {
+				if ( ! $this->doing_action ) {
 					$args[ 0 ] = $value;
 				}
 
 				// Avoid the array_slice if possible.
-				if ( $the_['accepted_args'] == 0 ) {
-					$value = call_user_func_array( $the_['function'], array() );
-				} elseif ( $the_['accepted_args'] >= $num_args ) {
-					$value = call_user_func_array( $the_['function'], $args );
+				if ( is_numeric( $the_['accepted_args'] ) && $the_['accepted_args'] == 0 ) {
+					$call_args = array();
+				} elseif ( $the_['accepted_args'] > 0 && $the_['accepted_args'] < $num_args ) {
+					$call_args = array_slice( $args, 0, (int) $the_['accepted_args'] );
 				} else {
-					$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
+					$call_args = $args;
 				}
+
+				$value = call_user_func_array( $the_['function'], $call_args );
 			}
 		} while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
diff --git a/tests/phpunit/tests/hooks/do_action.php b/tests/phpunit/tests/hooks/do_action.php
index b810d46..c7255f6 100755
--- a/tests/phpunit/tests/hooks/do_action.php
+++ b/tests/phpunit/tests/hooks/do_action.php
@@ -139,6 +139,27 @@ class Tests_WP_Hook_Do_Action extends WP_UnitTestCase {
 		$this->assertSame( 'a1-b1b3-a2a3', $this->action_output );
 	}
 
+	public function test_can_pass_all_args() {
+		$a = new MockAction();
+		$callback = array( $a, 'action' );
+		$hook = new WP_Hook();
+		$tag = rand_str();
+		$priority = rand( 1, 100 );
+		$accepted_args = -1; // will pass all
+
+		$args = array();
+		for ( $i = 1; $i <= rand( 5, 10 ); $i++ ) {
+			$args[] = rand_str();
+		}
+
+		$hook->add_filter( $tag, $callback, $priority, $accepted_args );
+		$hook->do_action( $args );
+
+		$called_args = $a->get_args();
+
+		$this->assertEquals( count( $args ), count( $called_args[0] ) );
+	}
+
 	public function _filter_do_action_doesnt_change_value1( $value ) {
 		$this->action_output .= $value . 1;
 		return 'x1';
