diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index 44c45a6d7f..e01b0e2fe4 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -674,7 +674,7 @@ function remove_all_actions($tag, $priority = false) { */ function apply_filters_deprecated( $tag, $args, $version, $replacement = false, $message = null ) { if ( ! has_filter( $tag ) ) { - return; + return $args[0]; } _deprecated_hook( $tag, $version, $replacement, $message ); diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php index b0bfcfb547..88fa71340c 100644 --- a/tests/phpunit/tests/filters.php +++ b/tests/phpunit/tests/filters.php @@ -359,4 +359,13 @@ class Tests_Filters extends WP_UnitTestCase { return $p1; } + + /** + * @ticket 10441 + */ + public function test_apply_filters_deprecated_without_filter() { + $val = 'Foobar'; + + $this->assertSame( $val, apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $val ), '4.6' ) ); + } }