From 00aff3a70634404f9877f592a0e60a2031ce6b1b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Nov 2019 13:55:43 +0000 Subject: [PATCH] Docs: Use 3-digit, x.x.x style semantic versioning for `$version` argument in `do_action_deprecated()` and `apply_filters_deprecated()` calls. Props jrf. Fixes #48255. git-svn-id: https://develop.svn.wordpress.org/trunk@46689 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/plugin.php | 2 +- tests/phpunit/tests/actions.php | 4 ++-- tests/phpunit/tests/filters.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/plugin.php b/src/wp-includes/plugin.php index 6e9de6c3f4..97a1ffd588 100644 --- a/src/wp-includes/plugin.php +++ b/src/wp-includes/plugin.php @@ -611,7 +611,7 @@ function remove_all_actions( $tag, $priority = false ) { * return apply_filters( 'wpdocs_filter', $value, $extra_arg ); * * // Deprecated. - * return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9', 'wpdocs_new_filter' ); + * return apply_filters_deprecated( 'wpdocs_filter', array( $value, $extra_arg ), '4.9.0', 'wpdocs_new_filter' ); * * @since 4.6.0 * diff --git a/tests/phpunit/tests/actions.php b/tests/phpunit/tests/actions.php index e83b6bfc15..fe30465774 100644 --- a/tests/phpunit/tests/actions.php +++ b/tests/phpunit/tests/actions.php @@ -546,7 +546,7 @@ class Tests_Actions extends WP_UnitTestCase { $p = new WP_Post( (object) array( 'post_title' => 'Foo' ) ); add_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback' ) ); - do_action_deprecated( 'tests_do_action_deprecated', array( $p ), '4.6' ); + do_action_deprecated( 'tests_do_action_deprecated', array( $p ), '4.6.0' ); remove_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback' ) ); $this->assertSame( 'Bar', $p->post_title ); @@ -565,7 +565,7 @@ class Tests_Actions extends WP_UnitTestCase { $p2 = new WP_Post( (object) array( 'post_title' => 'Foo2' ) ); add_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback_multiple_params' ), 10, 2 ); - do_action_deprecated( 'tests_do_action_deprecated', array( $p1, $p2 ), '4.6' ); + do_action_deprecated( 'tests_do_action_deprecated', array( $p1, $p2 ), '4.6.0' ); remove_action( 'tests_do_action_deprecated', array( __CLASS__, 'deprecated_action_callback_multiple_params' ), 10, 2 ); $this->assertSame( 'Bar1', $p1->post_title ); diff --git a/tests/phpunit/tests/filters.php b/tests/phpunit/tests/filters.php index 03af7e56ce..2060fe1c73 100644 --- a/tests/phpunit/tests/filters.php +++ b/tests/phpunit/tests/filters.php @@ -303,7 +303,7 @@ class Tests_Filters extends WP_UnitTestCase { $p = 'Foo'; add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) ); - $p = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p ), '4.6' ); + $p = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p ), '4.6.0' ); remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback' ) ); $this->assertSame( 'Bar', $p ); @@ -323,7 +323,7 @@ class Tests_Filters extends WP_UnitTestCase { $p2 = 'Foo2'; add_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 ); - $p1 = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p1, $p2 ), '4.6' ); + $p1 = apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $p1, $p2 ), '4.6.0' ); remove_filter( 'tests_apply_filters_deprecated', array( __CLASS__, 'deprecated_filter_callback_multiple_params' ), 10, 2 ); $this->assertSame( 'Bar1', $p1 ); @@ -345,7 +345,7 @@ class Tests_Filters extends WP_UnitTestCase { public function test_apply_filters_deprecated_without_filter() { $val = 'Foobar'; - $this->assertSame( $val, apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $val ), '4.6' ) ); + $this->assertSame( $val, apply_filters_deprecated( 'tests_apply_filters_deprecated', array( $val ), '4.6.0' ) ); } private $current_priority;