diff --git src/wp-includes/class-wp-rewrite.php src/wp-includes/class-wp-rewrite.php
index 17c58b90a8..6937380750 100644
--- src/wp-includes/class-wp-rewrite.php
+++ src/wp-includes/class-wp-rewrite.php
@@ -1798,6 +1798,7 @@ class WP_Rewrite {
 	 * @staticvar bool $do_hard_later
 	 *
 	 * @param bool $hard Whether to update .htaccess (hard flush) or just update rewrite_rules option (soft flush). Default is true (hard).
+	 * @return bool True on a hard flush attempt, false on a soft flush attempt.
 	 */
 	public function flush_rules( $hard = true ) {
 		static $do_hard_later = null;
@@ -1822,17 +1823,25 @@ class WP_Rewrite {
 		 *
 		 * A "hard" flush updates .htaccess (Apache) or web.config (IIS).
 		 *
-		 * @since 3.7.0
+		 * @since 4.8.0
 		 *
-		 * @param bool $hard Whether to flush rewrite rules "hard". Default true.
+		 * @param bool $hard Whether to flush rewrite rules "hard".
 		 */
-		if ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) ) {
-			return;
+		$hard = apply_filters( 'flush_rewrite_rules_hard', $hard );
+
+		if ( ! $hard ) {
+			return false;
 		}
-		if ( function_exists( 'save_mod_rewrite_rules' ) )
+
+		if ( function_exists( 'save_mod_rewrite_rules' ) ) {
 			save_mod_rewrite_rules();
-		if ( function_exists( 'iis7_save_url_rewrite_rules' ) )
+		}
+
+		if ( function_exists( 'iis7_save_url_rewrite_rules' ) ) {
 			iis7_save_url_rewrite_rules();
+		}
+
+		return true;
 	}
 
 	/**
diff --git src/wp-includes/rewrite.php src/wp-includes/rewrite.php
index 705e5f2bc8..fdba218a62 100644
--- src/wp-includes/rewrite.php
+++ src/wp-includes/rewrite.php
@@ -267,10 +267,11 @@ function add_feed( $feedname, $function ) {
  *
  * @param bool $hard Whether to update .htaccess (hard flush) or just update
  * 	                 rewrite_rules transient (soft flush). Default is true (hard).
+ * @return bool True on a hard flush attempt, false on a soft flush attempt.
  */
 function flush_rewrite_rules( $hard = true ) {
 	global $wp_rewrite;
-	$wp_rewrite->flush_rules( $hard );
+	return $wp_rewrite->flush_rules( $hard );
 }
 
 /**
diff --git tests/phpunit/tests/rewrite.php tests/phpunit/tests/rewrite.php
index dfa9749821..d37cb0e226 100644
--- tests/phpunit/tests/rewrite.php
+++ tests/phpunit/tests/rewrite.php
@@ -399,4 +399,50 @@ class Tests_Rewrite extends WP_UnitTestCase {
 		$this->assertInternalType( 'array', $rewrite_rules );
 		$this->assertNotEmpty( $rewrite_rules );
 	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_true_no_filters() {
+		$this->assertTrue( flush_rewrite_rules( true ) );
+	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_false_no_filters() {
+		$this->assertFalse( flush_rewrite_rules( false ) );
+	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_true_with_filters_true() {
+		add_filter( 'flush_rewrite_rules_hard', '__return_true' );
+		$this->assertTrue( flush_rewrite_rules( true ) );
+	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_true_with_filters_false() {
+		add_filter( 'flush_rewrite_rules_hard', '__return_false' );
+		$this->assertFalse( flush_rewrite_rules( true ) );
+	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_false_with_filters_true() {
+		add_filter( 'flush_rewrite_rules_hard', '__return_true' );
+		$this->assertTrue( flush_rewrite_rules( false ) );
+	}
+
+	/**
+	 * @ticket 28517
+	 */
+	function test_flush_rules_hard_false_with_filters_false() {
+		add_filter( 'flush_rewrite_rules_hard', '__return_false' );
+		$this->assertFalse( flush_rewrite_rules( false ) );
+	}
 }
