Code Modernization: Use "declare" in WP_List_Table magic methods deprecation message

Changes "define" to "declare" in the deprecation message in `WP_List_Table` magic methods.

Why is "declare" better?
It aligns well to:

* the topic of and published information about dynamic properties.
* the act of explicitly listing the variable as a property on the class.

The goal of this message is guide developers to change their code. Changing the term to "declare" hopefully will aid in the understanding of what is being asked of developers when this deprecation is thrown.

Follow-up [56349].

Props hellofromTonya, antonvlasenko.
Fixes #58896.
Built from https://develop.svn.wordpress.org/trunk@56356


git-svn-id: http://core.svn.wordpress.org/trunk@55868 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2023-08-03 19:52:22 +00:00
parent 5ccbf34eaa
commit 65da089d96
2 changed files with 9 additions and 9 deletions

View File

@ -187,8 +187,8 @@ class WP_List_Table {
} }
trigger_error( trigger_error(
"The property `{$name}` is not defined. Getting a dynamic (undefined) property is " . "The property `{$name}` is not declared. Getting a dynamic property is " .
'deprecated since version 6.4.0! Instead, define the property on the class.', 'deprecated since version 6.4.0! Instead, declare the property on the class.',
E_USER_DEPRECATED E_USER_DEPRECATED
); );
return null; return null;
@ -210,8 +210,8 @@ class WP_List_Table {
} }
trigger_error( trigger_error(
"The property `{$name}` is not defined. Setting a dynamic (undefined) property is " . "The property `{$name}` is not declared. Setting a dynamic property is " .
'deprecated since version 6.4.0! Instead, define the property on the class.', 'deprecated since version 6.4.0! Instead, declare the property on the class.',
E_USER_DEPRECATED E_USER_DEPRECATED
); );
} }
@ -231,8 +231,8 @@ class WP_List_Table {
} }
trigger_error( trigger_error(
"The property `{$name}` is not defined. Checking `isset()` on a dynamic (undefined) property " . "The property `{$name}` is not declared. Checking `isset()` on a dynamic property " .
'is deprecated since version 6.4.0! Instead, define the property on the class.', 'is deprecated since version 6.4.0! Instead, declare the property on the class.',
E_USER_DEPRECATED E_USER_DEPRECATED
); );
return false; return false;
@ -253,8 +253,8 @@ class WP_List_Table {
} }
trigger_error( trigger_error(
"A property `{$name}` is not defined. Unsetting a dynamic (undefined) property is " . "A property `{$name}` is not declared. Unsetting a dynamic property is " .
'deprecated since version 6.4.0! Instead, define the property on the class.', 'deprecated since version 6.4.0! Instead, declare the property on the class.',
E_USER_DEPRECATED E_USER_DEPRECATED
); );
} }

View File

@ -16,7 +16,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '6.4-alpha-56355'; $wp_version = '6.4-alpha-56356';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.