diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index b8631d17a2..c7c38a3561 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -176,6 +176,7 @@ class WP_List_Table { * Makes private properties readable for backward compatibility. * * @since 4.0.0 + * @since 6.4.0 Getting a dynamic property is deprecated. * * @param string $name Property to get. * @return mixed Property. @@ -184,27 +185,42 @@ class WP_List_Table { if ( in_array( $name, $this->compat_fields, true ) ) { return $this->$name; } + + trigger_error( + "The property `{$name}` is not defined. Getting a dynamic (undefined) property is " . + 'deprecated since version 6.4.0! Instead, define the property on the class.', + E_USER_DEPRECATED + ); + return null; } /** * Makes private properties settable for backward compatibility. * * @since 4.0.0 + * @since 6.4.0 Setting a dynamic property is deprecated. * * @param string $name Property to check if set. * @param mixed $value Property value. - * @return mixed Newly-set property. */ public function __set( $name, $value ) { if ( in_array( $name, $this->compat_fields, true ) ) { - return $this->$name = $value; + $this->$name = $value; + return; } + + trigger_error( + "The property `{$name}` is not defined. Setting a dynamic (undefined) property is " . + 'deprecated since version 6.4.0! Instead, define the property on the class.', + E_USER_DEPRECATED + ); } /** * Makes private properties checkable for backward compatibility. * * @since 4.0.0 + * @since 6.4.0 Checking a dynamic property is deprecated. * * @param string $name Property to check if set. * @return bool Whether the property is a back-compat property and it is set. @@ -214,6 +230,11 @@ class WP_List_Table { return isset( $this->$name ); } + trigger_error( + "The property `{$name}` is not defined. Checking `isset()` on a dynamic (undefined) property " . + 'is deprecated since version 6.4.0! Instead, define the property on the class.', + E_USER_DEPRECATED + ); return false; } @@ -221,13 +242,21 @@ class WP_List_Table { * Makes private properties un-settable for backward compatibility. * * @since 4.0.0 + * @since 6.4.0 Unsetting a dynamic property is deprecated. * * @param string $name Property to unset. */ public function __unset( $name ) { if ( in_array( $name, $this->compat_fields, true ) ) { unset( $this->$name ); + return; } + + trigger_error( + "A property `{$name}` is not defined. Unsetting a dynamic (undefined) property is " . + 'deprecated since version 6.4.0! Instead, define the property on the class.', + E_USER_DEPRECATED + ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 15c01c77e6..faf79696a8 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56348'; +$wp_version = '6.4-alpha-56349'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.