From c03305852e7e40e61cad5798eba9ebc3b961e27a Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 12 Sep 2022 15:47:14 +0000 Subject: [PATCH] Code Modernization: Add `AllowDynamicProperties` attribute to all (parent) classes. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dynamic (non-explicitly declared) properties are deprecated as of PHP 8.2 and are expected to become a fatal error in PHP 9.0. There are a number of ways to mitigate this: * If it is an accidental typo for a declared property: fix the typo. * For known properties: declare them on the class. * For unknown properties: add the magic `__get()`, `__set()`, et al. methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods built in. * For unknown ''use'' of dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes. Trac ticket #56034 is open to investigate and handle the third and fourth type of situations, however it has become clear this will need more time and will not be ready in time for WP 6.1. To reduce “noise” in the meantime, both in the error logs of WP users moving onto PHP 8.2, in the test run logs of WP itself, in test runs of plugins and themes, as well as to prevent duplicate tickets from being opened for the same issue, this commit adds the `#[AllowDynamicProperties]` attribute to all “parent” classes in WP. The logic used for this commit is as follows: * If a class already has the attribute: no action needed. * If a class does not `extend`: add the attribute. * If a class does `extend`: - If it extends `stdClass`: no action needed (as `stdClass` supports dynamic properties). - If it extends a PHP native class: add the attribute. - If it extends a class from one of WP's external dependencies: add the attribute. * In all other cases: no action — the attribute should not be needed as child classes inherit from the parent. Whether or not a class contains magic methods has not been taken into account, as a review of the currently existing magic methods has shown that those are generally not sturdy enough and often even set dynamic properties (which they should not). See the [https://www.youtube.com/watch?v=vDZWepDQQVE live stream from August 16, 2022] for more details. This commit only affects classes in the `src` directory of WordPress core. * Tests should not get this attribute, but should be fixed to not use dynamic properties instead. Patches for this are already being committed under ticket #56033. * While a number bundled themes (2014, 2019, 2020, 2021) contain classes, they are not a part of this commit and may be updated separately. Reference: [https://wiki.php.net/rfc/deprecate_dynamic_properties PHP RFC: Deprecate dynamic properties]. Follow-up to [53922]. Props jrf, hellofromTonya, markjaquith, peterwilsoncc, costdev, knutsp, aristath. See #56513, #56034. Built from https://develop.svn.wordpress.org/trunk@54133 git-svn-id: http://core.svn.wordpress.org/trunk@53692 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/class-custom-background.php | 1 + wp-admin/includes/class-custom-image-header.php | 1 + wp-admin/includes/class-file-upload-upgrader.php | 1 + wp-admin/includes/class-wp-automatic-updater.php | 1 + wp-admin/includes/class-wp-community-events.php | 1 + wp-admin/includes/class-wp-debug-data.php | 1 + wp-admin/includes/class-wp-filesystem-base.php | 1 + wp-admin/includes/class-wp-importer.php | 1 + wp-admin/includes/class-wp-internal-pointers.php | 1 + wp-admin/includes/class-wp-list-table.php | 1 + wp-admin/includes/class-wp-privacy-policy-content.php | 1 + wp-admin/includes/class-wp-screen.php | 1 + wp-admin/includes/class-wp-site-health-auto-updates.php | 1 + wp-admin/includes/class-wp-site-health.php | 1 + wp-admin/includes/class-wp-site-icon.php | 1 + wp-admin/includes/class-wp-upgrader-skin.php | 1 + wp-admin/includes/class-wp-upgrader.php | 1 + wp-includes/class-wp-admin-bar.php | 1 + wp-includes/class-wp-ajax-response.php | 1 + wp-includes/class-wp-application-passwords.php | 1 + wp-includes/class-wp-block-editor-context.php | 1 + wp-includes/class-wp-block-list.php | 1 + wp-includes/class-wp-block-pattern-categories-registry.php | 1 + wp-includes/class-wp-block-patterns-registry.php | 1 + wp-includes/class-wp-block-styles-registry.php | 1 + wp-includes/class-wp-block-supports.php | 1 + wp-includes/class-wp-block-template.php | 1 + wp-includes/class-wp-block-type-registry.php | 1 + wp-includes/class-wp-block-type.php | 1 + wp-includes/class-wp-block.php | 1 + wp-includes/class-wp-comment-query.php | 1 + wp-includes/class-wp-comment.php | 1 + wp-includes/class-wp-customize-control.php | 1 + wp-includes/class-wp-customize-manager.php | 1 + wp-includes/class-wp-customize-nav-menus.php | 1 + wp-includes/class-wp-customize-panel.php | 1 + wp-includes/class-wp-customize-section.php | 1 + wp-includes/class-wp-customize-setting.php | 1 + wp-includes/class-wp-customize-widgets.php | 1 + wp-includes/class-wp-date-query.php | 1 + wp-includes/class-wp-dependency.php | 1 + wp-includes/class-wp-editor.php | 1 + wp-includes/class-wp-embed.php | 1 + wp-includes/class-wp-error.php | 1 + wp-includes/class-wp-fatal-error-handler.php | 1 + wp-includes/class-wp-feed-cache-transient.php | 1 + wp-includes/class-wp-feed-cache.php | 1 + wp-includes/class-wp-hook.php | 1 + wp-includes/class-wp-http-cookie.php | 1 + wp-includes/class-wp-http-curl.php | 1 + wp-includes/class-wp-http-encoding.php | 1 + wp-includes/class-wp-http-ixr-client.php | 1 + wp-includes/class-wp-http-proxy.php | 1 + wp-includes/class-wp-http-requests-hooks.php | 1 + wp-includes/class-wp-http-response.php | 1 + wp-includes/class-wp-http-streams.php | 1 + wp-includes/class-wp-http.php | 1 + wp-includes/class-wp-image-editor.php | 1 + wp-includes/class-wp-list-util.php | 1 + wp-includes/class-wp-locale-switcher.php | 1 + wp-includes/class-wp-locale.php | 1 + wp-includes/class-wp-matchesmapregex.php | 1 + wp-includes/class-wp-meta-query.php | 1 + wp-includes/class-wp-metadata-lazyloader.php | 1 + wp-includes/class-wp-network-query.php | 1 + wp-includes/class-wp-network.php | 1 + wp-includes/class-wp-object-cache.php | 1 + wp-includes/class-wp-oembed-controller.php | 1 + wp-includes/class-wp-oembed.php | 1 + wp-includes/class-wp-paused-extensions-storage.php | 1 + wp-includes/class-wp-post-type.php | 1 + wp-includes/class-wp-post.php | 1 + wp-includes/class-wp-query.php | 1 + wp-includes/class-wp-recovery-mode-cookie-service.php | 1 + wp-includes/class-wp-recovery-mode-email-service.php | 1 + wp-includes/class-wp-recovery-mode-key-service.php | 1 + wp-includes/class-wp-recovery-mode-link-service.php | 1 + wp-includes/class-wp-recovery-mode.php | 1 + wp-includes/class-wp-rewrite.php | 1 + wp-includes/class-wp-role.php | 1 + wp-includes/class-wp-roles.php | 1 + wp-includes/class-wp-session-tokens.php | 1 + wp-includes/class-wp-simplepie-file.php | 1 + wp-includes/class-wp-simplepie-sanitize-kses.php | 1 + wp-includes/class-wp-site-query.php | 1 + wp-includes/class-wp-site.php | 1 + wp-includes/class-wp-tax-query.php | 1 + wp-includes/class-wp-taxonomy.php | 1 + wp-includes/class-wp-term-query.php | 1 + wp-includes/class-wp-term.php | 1 + wp-includes/class-wp-text-diff-renderer-inline.php | 1 + wp-includes/class-wp-text-diff-renderer-table.php | 1 + wp-includes/class-wp-textdomain-registry.php | 1 + wp-includes/class-wp-theme-json-resolver.php | 1 + wp-includes/class-wp-theme-json-schema.php | 1 + wp-includes/class-wp-theme-json.php | 1 + wp-includes/class-wp-theme.php | 1 + wp-includes/class-wp-user-query.php | 1 + wp-includes/class-wp-user-request.php | 1 + wp-includes/class-wp-user.php | 1 + wp-includes/class-wp-walker.php | 1 + wp-includes/class-wp-widget-factory.php | 1 + wp-includes/class-wp-widget.php | 1 + wp-includes/class-wp-xmlrpc-server.php | 1 + wp-includes/class-wp.php | 1 + wp-includes/class-wpdb.php | 1 + wp-includes/class.wp-dependencies.php | 1 + wp-includes/customize/class-wp-customize-partial.php | 1 + wp-includes/customize/class-wp-customize-selective-refresh.php | 1 + wp-includes/pomo/entry.php | 1 + wp-includes/pomo/plural-forms.php | 1 + wp-includes/pomo/streams.php | 1 + wp-includes/pomo/translations.php | 2 ++ wp-includes/rest-api/class-wp-rest-request.php | 1 + wp-includes/rest-api/class-wp-rest-server.php | 1 + wp-includes/rest-api/endpoints/class-wp-rest-controller.php | 1 + wp-includes/rest-api/fields/class-wp-rest-meta-fields.php | 1 + wp-includes/rest-api/search/class-wp-rest-search-handler.php | 1 + wp-includes/sitemaps/class-wp-sitemaps-index.php | 1 + wp-includes/sitemaps/class-wp-sitemaps-provider.php | 1 + wp-includes/sitemaps/class-wp-sitemaps-registry.php | 1 + wp-includes/sitemaps/class-wp-sitemaps-renderer.php | 1 + wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php | 1 + wp-includes/sitemaps/class-wp-sitemaps.php | 1 + wp-includes/version.php | 2 +- 125 files changed, 126 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/class-custom-background.php b/wp-admin/includes/class-custom-background.php index fa89e10e42..07a72dd1b1 100644 --- a/wp-admin/includes/class-custom-background.php +++ b/wp-admin/includes/class-custom-background.php @@ -11,6 +11,7 @@ * * @since 3.0.0 */ +#[AllowDynamicProperties] class Custom_Background { /** diff --git a/wp-admin/includes/class-custom-image-header.php b/wp-admin/includes/class-custom-image-header.php index e59cd16284..c8809ade2f 100644 --- a/wp-admin/includes/class-custom-image-header.php +++ b/wp-admin/includes/class-custom-image-header.php @@ -11,6 +11,7 @@ * * @since 2.1.0 */ +#[AllowDynamicProperties] class Custom_Image_Header { /** diff --git a/wp-admin/includes/class-file-upload-upgrader.php b/wp-admin/includes/class-file-upload-upgrader.php index 28cc4402c7..d7c459dd60 100644 --- a/wp-admin/includes/class-file-upload-upgrader.php +++ b/wp-admin/includes/class-file-upload-upgrader.php @@ -16,6 +16,7 @@ * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. */ +#[AllowDynamicProperties] class File_Upload_Upgrader { /** diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index c8227c3fc3..e453539deb 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -13,6 +13,7 @@ * @since 3.7.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader.php. */ +#[AllowDynamicProperties] class WP_Automatic_Updater { /** diff --git a/wp-admin/includes/class-wp-community-events.php b/wp-admin/includes/class-wp-community-events.php index 3f43f8d1db..1a09bec848 100644 --- a/wp-admin/includes/class-wp-community-events.php +++ b/wp-admin/includes/class-wp-community-events.php @@ -14,6 +14,7 @@ * * @since 4.8.0 */ +#[AllowDynamicProperties] class WP_Community_Events { /** * ID for a WordPress user account. diff --git a/wp-admin/includes/class-wp-debug-data.php b/wp-admin/includes/class-wp-debug-data.php index a921fc4dcb..ab0926d3ac 100644 --- a/wp-admin/includes/class-wp-debug-data.php +++ b/wp-admin/includes/class-wp-debug-data.php @@ -7,6 +7,7 @@ * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Debug_Data { /** * Calls all core functions to check for updates. diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index 8d83b24dd6..aae09e8dfa 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -11,6 +11,7 @@ * * @since 2.5.0 */ +#[AllowDynamicProperties] class WP_Filesystem_Base { /** diff --git a/wp-admin/includes/class-wp-importer.php b/wp-admin/includes/class-wp-importer.php index 4c6d518f97..4804c888b2 100644 --- a/wp-admin/includes/class-wp-importer.php +++ b/wp-admin/includes/class-wp-importer.php @@ -2,6 +2,7 @@ /** * WP_Importer base class */ +#[AllowDynamicProperties] class WP_Importer { /** * Class Constructor diff --git a/wp-admin/includes/class-wp-internal-pointers.php b/wp-admin/includes/class-wp-internal-pointers.php index 08cf817744..884f27ea1f 100644 --- a/wp-admin/includes/class-wp-internal-pointers.php +++ b/wp-admin/includes/class-wp-internal-pointers.php @@ -12,6 +12,7 @@ * * @since 3.3.0 */ +#[AllowDynamicProperties] final class WP_Internal_Pointers { /** * Initializes the new feature pointers. diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 599c69d2ad..046e9515d8 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -13,6 +13,7 @@ * @since 3.1.0 * @access private */ +#[AllowDynamicProperties] class WP_List_Table { /** diff --git a/wp-admin/includes/class-wp-privacy-policy-content.php b/wp-admin/includes/class-wp-privacy-policy-content.php index bbc46c0a70..9b11d09a66 100644 --- a/wp-admin/includes/class-wp-privacy-policy-content.php +++ b/wp-admin/includes/class-wp-privacy-policy-content.php @@ -7,6 +7,7 @@ * @since 4.9.6 */ +#[AllowDynamicProperties] final class WP_Privacy_Policy_Content { private static $policy_content = array(); diff --git a/wp-admin/includes/class-wp-screen.php b/wp-admin/includes/class-wp-screen.php index 7caf17beb5..7b7290011c 100644 --- a/wp-admin/includes/class-wp-screen.php +++ b/wp-admin/includes/class-wp-screen.php @@ -12,6 +12,7 @@ * * @since 3.3.0 */ +#[AllowDynamicProperties] final class WP_Screen { /** * Any action associated with the screen. diff --git a/wp-admin/includes/class-wp-site-health-auto-updates.php b/wp-admin/includes/class-wp-site-health-auto-updates.php index 5393b6f3c9..4880d02302 100644 --- a/wp-admin/includes/class-wp-site-health-auto-updates.php +++ b/wp-admin/includes/class-wp-site-health-auto-updates.php @@ -7,6 +7,7 @@ * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Site_Health_Auto_Updates { /** * WP_Site_Health_Auto_Updates constructor. diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 7c94e8be10..3c717cc659 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -7,6 +7,7 @@ * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Site_Health { private static $instance = null; diff --git a/wp-admin/includes/class-wp-site-icon.php b/wp-admin/includes/class-wp-site-icon.php index d153b6f826..e799c7fb79 100644 --- a/wp-admin/includes/class-wp-site-icon.php +++ b/wp-admin/includes/class-wp-site-icon.php @@ -12,6 +12,7 @@ * * @since 4.3.0 */ +#[AllowDynamicProperties] class WP_Site_Icon { /** diff --git a/wp-admin/includes/class-wp-upgrader-skin.php b/wp-admin/includes/class-wp-upgrader-skin.php index bb7e7bbf3b..d0d2a39b01 100644 --- a/wp-admin/includes/class-wp-upgrader-skin.php +++ b/wp-admin/includes/class-wp-upgrader-skin.php @@ -13,6 +13,7 @@ * @since 2.8.0 * @since 4.6.0 Moved to its own file from wp-admin/includes/class-wp-upgrader-skins.php. */ +#[AllowDynamicProperties] class WP_Upgrader_Skin { /** diff --git a/wp-admin/includes/class-wp-upgrader.php b/wp-admin/includes/class-wp-upgrader.php index 412b383abe..a2b2c9ed06 100644 --- a/wp-admin/includes/class-wp-upgrader.php +++ b/wp-admin/includes/class-wp-upgrader.php @@ -48,6 +48,7 @@ require_once ABSPATH . 'wp-admin/includes/class-wp-ajax-upgrader-skin.php'; * * @since 2.8.0 */ +#[AllowDynamicProperties] class WP_Upgrader { /** diff --git a/wp-includes/class-wp-admin-bar.php b/wp-includes/class-wp-admin-bar.php index 6eab9c3fdb..406d76459b 100644 --- a/wp-includes/class-wp-admin-bar.php +++ b/wp-includes/class-wp-admin-bar.php @@ -12,6 +12,7 @@ * * @since 3.1.0 */ +#[AllowDynamicProperties] class WP_Admin_Bar { private $nodes = array(); private $bound = false; diff --git a/wp-includes/class-wp-ajax-response.php b/wp-includes/class-wp-ajax-response.php index e4024102a8..fb90d2ddac 100644 --- a/wp-includes/class-wp-ajax-response.php +++ b/wp-includes/class-wp-ajax-response.php @@ -5,6 +5,7 @@ * @package WordPress * @since 2.1.0 */ +#[AllowDynamicProperties] class WP_Ajax_Response { /** * Store XML responses to send. diff --git a/wp-includes/class-wp-application-passwords.php b/wp-includes/class-wp-application-passwords.php index c41f8ad372..c4e34350fc 100644 --- a/wp-includes/class-wp-application-passwords.php +++ b/wp-includes/class-wp-application-passwords.php @@ -11,6 +11,7 @@ * * @package WordPress */ +#[AllowDynamicProperties] class WP_Application_Passwords { /** diff --git a/wp-includes/class-wp-block-editor-context.php b/wp-includes/class-wp-block-editor-context.php index fd594bcad0..bb2d44e5a1 100644 --- a/wp-includes/class-wp-block-editor-context.php +++ b/wp-includes/class-wp-block-editor-context.php @@ -11,6 +11,7 @@ * * @since 5.8.0 */ +#[AllowDynamicProperties] final class WP_Block_Editor_Context { /** * String that identifies the block editor being rendered. Can be one of: diff --git a/wp-includes/class-wp-block-list.php b/wp-includes/class-wp-block-list.php index 2b0750bfee..9b7caaf01f 100644 --- a/wp-includes/class-wp-block-list.php +++ b/wp-includes/class-wp-block-list.php @@ -11,6 +11,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Block_List implements Iterator, ArrayAccess, Countable { /** diff --git a/wp-includes/class-wp-block-pattern-categories-registry.php b/wp-includes/class-wp-block-pattern-categories-registry.php index f4d881c4e2..3d37a5940a 100644 --- a/wp-includes/class-wp-block-pattern-categories-registry.php +++ b/wp-includes/class-wp-block-pattern-categories-registry.php @@ -10,6 +10,7 @@ /** * Class used for interacting with block pattern categories. */ +#[AllowDynamicProperties] final class WP_Block_Pattern_Categories_Registry { /** * Registered block pattern categories array. diff --git a/wp-includes/class-wp-block-patterns-registry.php b/wp-includes/class-wp-block-patterns-registry.php index 8b312d56c2..bfbc651341 100644 --- a/wp-includes/class-wp-block-patterns-registry.php +++ b/wp-includes/class-wp-block-patterns-registry.php @@ -12,6 +12,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] final class WP_Block_Patterns_Registry { /** * Registered block patterns array. diff --git a/wp-includes/class-wp-block-styles-registry.php b/wp-includes/class-wp-block-styles-registry.php index b9a59f6d6e..317c6489b2 100644 --- a/wp-includes/class-wp-block-styles-registry.php +++ b/wp-includes/class-wp-block-styles-registry.php @@ -12,6 +12,7 @@ * * @since 5.3.0 */ +#[AllowDynamicProperties] final class WP_Block_Styles_Registry { /** * Registered block styles, as `$block_name => $block_style_name => $block_style_properties` multidimensional arrays. diff --git a/wp-includes/class-wp-block-supports.php b/wp-includes/class-wp-block-supports.php index 703d03a629..a8e2ecb36b 100644 --- a/wp-includes/class-wp-block-supports.php +++ b/wp-includes/class-wp-block-supports.php @@ -14,6 +14,7 @@ * * @access private */ +#[AllowDynamicProperties] class WP_Block_Supports { /** diff --git a/wp-includes/class-wp-block-template.php b/wp-includes/class-wp-block-template.php index 51dbdbfbc3..898ddf0dd3 100644 --- a/wp-includes/class-wp-block-template.php +++ b/wp-includes/class-wp-block-template.php @@ -11,6 +11,7 @@ * * @since 5.8.0 */ +#[AllowDynamicProperties] class WP_Block_Template { /** diff --git a/wp-includes/class-wp-block-type-registry.php b/wp-includes/class-wp-block-type-registry.php index c9a5776c55..84adecd5d0 100644 --- a/wp-includes/class-wp-block-type-registry.php +++ b/wp-includes/class-wp-block-type-registry.php @@ -12,6 +12,7 @@ * * @since 5.0.0 */ +#[AllowDynamicProperties] final class WP_Block_Type_Registry { /** * Registered block types, as `$name => $instance` pairs. diff --git a/wp-includes/class-wp-block-type.php b/wp-includes/class-wp-block-type.php index 1c01120f87..10ad3e0422 100644 --- a/wp-includes/class-wp-block-type.php +++ b/wp-includes/class-wp-block-type.php @@ -14,6 +14,7 @@ * * @see register_block_type() */ +#[AllowDynamicProperties] class WP_Block_Type { /** diff --git a/wp-includes/class-wp-block.php b/wp-includes/class-wp-block.php index 33c0e6a355..9be22081c3 100644 --- a/wp-includes/class-wp-block.php +++ b/wp-includes/class-wp-block.php @@ -12,6 +12,7 @@ * @since 5.5.0 * @property array $attributes */ +#[AllowDynamicProperties] class WP_Block { /** diff --git a/wp-includes/class-wp-comment-query.php b/wp-includes/class-wp-comment-query.php index 5b0ce51dab..dad512c419 100644 --- a/wp-includes/class-wp-comment-query.php +++ b/wp-includes/class-wp-comment-query.php @@ -14,6 +14,7 @@ * * @see WP_Comment_Query::__construct() for accepted arguments. */ +#[AllowDynamicProperties] class WP_Comment_Query { /** diff --git a/wp-includes/class-wp-comment.php b/wp-includes/class-wp-comment.php index 864065b7ec..c5f8cc49f4 100644 --- a/wp-includes/class-wp-comment.php +++ b/wp-includes/class-wp-comment.php @@ -12,6 +12,7 @@ * * @since 4.4.0 */ +#[AllowDynamicProperties] final class WP_Comment { /** diff --git a/wp-includes/class-wp-customize-control.php b/wp-includes/class-wp-customize-control.php index 63cc5f65ae..64ed528cc2 100644 --- a/wp-includes/class-wp-customize-control.php +++ b/wp-includes/class-wp-customize-control.php @@ -12,6 +12,7 @@ * * @since 3.4.0 */ +#[AllowDynamicProperties] class WP_Customize_Control { /** diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 3b3259c573..e53a6ec477 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -20,6 +20,7 @@ * * @since 3.4.0 */ +#[AllowDynamicProperties] final class WP_Customize_Manager { /** * An instance of the theme being previewed. diff --git a/wp-includes/class-wp-customize-nav-menus.php b/wp-includes/class-wp-customize-nav-menus.php index 341a7f572a..d34fc59b97 100644 --- a/wp-includes/class-wp-customize-nav-menus.php +++ b/wp-includes/class-wp-customize-nav-menus.php @@ -16,6 +16,7 @@ * * @see WP_Customize_Manager */ +#[AllowDynamicProperties] final class WP_Customize_Nav_Menus { /** diff --git a/wp-includes/class-wp-customize-panel.php b/wp-includes/class-wp-customize-panel.php index 88d72f83fc..14ec8aad46 100644 --- a/wp-includes/class-wp-customize-panel.php +++ b/wp-includes/class-wp-customize-panel.php @@ -16,6 +16,7 @@ * * @see WP_Customize_Manager */ +#[AllowDynamicProperties] class WP_Customize_Panel { /** diff --git a/wp-includes/class-wp-customize-section.php b/wp-includes/class-wp-customize-section.php index 97da8a9e35..87b176c301 100644 --- a/wp-includes/class-wp-customize-section.php +++ b/wp-includes/class-wp-customize-section.php @@ -16,6 +16,7 @@ * * @see WP_Customize_Manager */ +#[AllowDynamicProperties] class WP_Customize_Section { /** diff --git a/wp-includes/class-wp-customize-setting.php b/wp-includes/class-wp-customize-setting.php index e7a1030c76..33b9436f85 100644 --- a/wp-includes/class-wp-customize-setting.php +++ b/wp-includes/class-wp-customize-setting.php @@ -17,6 +17,7 @@ * @see WP_Customize_Manager * @link https://developer.wordpress.org/themes/customize-api */ +#[AllowDynamicProperties] class WP_Customize_Setting { /** * Customizer bootstrap instance. diff --git a/wp-includes/class-wp-customize-widgets.php b/wp-includes/class-wp-customize-widgets.php index 9b4a0fa1c5..2bf8a39a25 100644 --- a/wp-includes/class-wp-customize-widgets.php +++ b/wp-includes/class-wp-customize-widgets.php @@ -16,6 +16,7 @@ * * @see WP_Customize_Manager */ +#[AllowDynamicProperties] final class WP_Customize_Widgets { /** diff --git a/wp-includes/class-wp-date-query.php b/wp-includes/class-wp-date-query.php index 1fa3652176..faa657dde5 100644 --- a/wp-includes/class-wp-date-query.php +++ b/wp-includes/class-wp-date-query.php @@ -14,6 +14,7 @@ * * @since 3.7.0 */ +#[AllowDynamicProperties] class WP_Date_Query { /** * Array of date queries. diff --git a/wp-includes/class-wp-dependency.php b/wp-includes/class-wp-dependency.php index ad4cd11caa..c4335b9bab 100644 --- a/wp-includes/class-wp-dependency.php +++ b/wp-includes/class-wp-dependency.php @@ -16,6 +16,7 @@ * @access private * @since 2.6.0 */ +#[AllowDynamicProperties] class _WP_Dependency { /** * The handle name. diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index 9a772d909c..41f379a838 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -8,6 +8,7 @@ * Private, not included by default. See wp_editor() in wp-includes/general-template.php. */ +#[AllowDynamicProperties] final class _WP_Editors { public static $mce_locale; diff --git a/wp-includes/class-wp-embed.php b/wp-includes/class-wp-embed.php index 677a5944c4..8ce3483228 100644 --- a/wp-includes/class-wp-embed.php +++ b/wp-includes/class-wp-embed.php @@ -6,6 +6,7 @@ * @subpackage Embed * @since 2.9.0 */ +#[AllowDynamicProperties] class WP_Embed { public $handlers = array(); public $post_ID; diff --git a/wp-includes/class-wp-error.php b/wp-includes/class-wp-error.php index d34c70a2e9..c8a976fb14 100644 --- a/wp-includes/class-wp-error.php +++ b/wp-includes/class-wp-error.php @@ -15,6 +15,7 @@ * * @since 2.1.0 */ +#[AllowDynamicProperties] class WP_Error { /** * Stores the list of errors. diff --git a/wp-includes/class-wp-fatal-error-handler.php b/wp-includes/class-wp-fatal-error-handler.php index 1fc5e0b968..55d328fbab 100644 --- a/wp-includes/class-wp-fatal-error-handler.php +++ b/wp-includes/class-wp-fatal-error-handler.php @@ -16,6 +16,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Fatal_Error_Handler { /** diff --git a/wp-includes/class-wp-feed-cache-transient.php b/wp-includes/class-wp-feed-cache-transient.php index f304ef8a6e..1d39932af4 100644 --- a/wp-includes/class-wp-feed-cache-transient.php +++ b/wp-includes/class-wp-feed-cache-transient.php @@ -12,6 +12,7 @@ * * @since 2.8.0 */ +#[AllowDynamicProperties] class WP_Feed_Cache_Transient { /** diff --git a/wp-includes/class-wp-feed-cache.php b/wp-includes/class-wp-feed-cache.php index b3d03ab422..d86b0fb7db 100644 --- a/wp-includes/class-wp-feed-cache.php +++ b/wp-includes/class-wp-feed-cache.php @@ -22,6 +22,7 @@ _deprecated_file( * * @see SimplePie_Cache */ +#[AllowDynamicProperties] class WP_Feed_Cache extends SimplePie_Cache { /** diff --git a/wp-includes/class-wp-hook.php b/wp-includes/class-wp-hook.php index 018db1c967..4796503dcc 100644 --- a/wp-includes/class-wp-hook.php +++ b/wp-includes/class-wp-hook.php @@ -15,6 +15,7 @@ * @see Iterator * @see ArrayAccess */ +#[AllowDynamicProperties] final class WP_Hook implements Iterator, ArrayAccess { /** diff --git a/wp-includes/class-wp-http-cookie.php b/wp-includes/class-wp-http-cookie.php index 5fa2de7644..7f5a64d023 100644 --- a/wp-includes/class-wp-http-cookie.php +++ b/wp-includes/class-wp-http-cookie.php @@ -18,6 +18,7 @@ * * @since 2.8.0 */ +#[AllowDynamicProperties] class WP_Http_Cookie { /** diff --git a/wp-includes/class-wp-http-curl.php b/wp-includes/class-wp-http-curl.php index 0e389c4563..9b201af110 100644 --- a/wp-includes/class-wp-http-curl.php +++ b/wp-includes/class-wp-http-curl.php @@ -16,6 +16,7 @@ * * @since 2.7.0 */ +#[AllowDynamicProperties] class WP_Http_Curl { /** diff --git a/wp-includes/class-wp-http-encoding.php b/wp-includes/class-wp-http-encoding.php index e9e94e4d77..255b2114ea 100644 --- a/wp-includes/class-wp-http-encoding.php +++ b/wp-includes/class-wp-http-encoding.php @@ -14,6 +14,7 @@ * * @since 2.8.0 */ +#[AllowDynamicProperties] class WP_Http_Encoding { /** diff --git a/wp-includes/class-wp-http-ixr-client.php b/wp-includes/class-wp-http-ixr-client.php index fef16e831d..d45ca150eb 100644 --- a/wp-includes/class-wp-http-ixr-client.php +++ b/wp-includes/class-wp-http-ixr-client.php @@ -5,6 +5,7 @@ * @package WordPress * @since 3.1.0 */ +#[AllowDynamicProperties] class WP_HTTP_IXR_Client extends IXR_Client { public $scheme; /** diff --git a/wp-includes/class-wp-http-proxy.php b/wp-includes/class-wp-http-proxy.php index 4408b9ba26..3e3d1f684e 100644 --- a/wp-includes/class-wp-http-proxy.php +++ b/wp-includes/class-wp-http-proxy.php @@ -39,6 +39,7 @@ * * @since 2.8.0 */ +#[AllowDynamicProperties] class WP_HTTP_Proxy { /** diff --git a/wp-includes/class-wp-http-requests-hooks.php b/wp-includes/class-wp-http-requests-hooks.php index c54fdc0b8f..dac64dd6eb 100644 --- a/wp-includes/class-wp-http-requests-hooks.php +++ b/wp-includes/class-wp-http-requests-hooks.php @@ -14,6 +14,7 @@ * * @see Requests_Hooks */ +#[AllowDynamicProperties] class WP_HTTP_Requests_Hooks extends Requests_Hooks { /** * Requested URL. diff --git a/wp-includes/class-wp-http-response.php b/wp-includes/class-wp-http-response.php index ae28d8954b..d102877885 100644 --- a/wp-includes/class-wp-http-response.php +++ b/wp-includes/class-wp-http-response.php @@ -12,6 +12,7 @@ * * @since 4.4.0 */ +#[AllowDynamicProperties] class WP_HTTP_Response { /** diff --git a/wp-includes/class-wp-http-streams.php b/wp-includes/class-wp-http-streams.php index a5d0694da3..48078cfafa 100644 --- a/wp-includes/class-wp-http-streams.php +++ b/wp-includes/class-wp-http-streams.php @@ -13,6 +13,7 @@ * @since 2.7.0 * @since 3.7.0 Combined with the fsockopen transport and switched to `stream_socket_client()`. */ +#[AllowDynamicProperties] class WP_Http_Streams { /** * Send a HTTP request to a URI using PHP Streams. diff --git a/wp-includes/class-wp-http.php b/wp-includes/class-wp-http.php index 73be956f4d..e96713e718 100644 --- a/wp-includes/class-wp-http.php +++ b/wp-includes/class-wp-http.php @@ -25,6 +25,7 @@ if ( ! class_exists( 'Requests' ) ) { * * @since 2.7.0 */ +#[AllowDynamicProperties] class WP_Http { // Aliases for HTTP response codes. diff --git a/wp-includes/class-wp-image-editor.php b/wp-includes/class-wp-image-editor.php index db94fc7dfe..67d1bda83f 100644 --- a/wp-includes/class-wp-image-editor.php +++ b/wp-includes/class-wp-image-editor.php @@ -11,6 +11,7 @@ * * @since 3.5.0 */ +#[AllowDynamicProperties] abstract class WP_Image_Editor { protected $file = null; protected $size = null; diff --git a/wp-includes/class-wp-list-util.php b/wp-includes/class-wp-list-util.php index 49fd3a00af..a2ccfb5412 100644 --- a/wp-includes/class-wp-list-util.php +++ b/wp-includes/class-wp-list-util.php @@ -13,6 +13,7 @@ * * @since 4.7.0 */ +#[AllowDynamicProperties] class WP_List_Util { /** * The input array. diff --git a/wp-includes/class-wp-locale-switcher.php b/wp-includes/class-wp-locale-switcher.php index 3cbd613a43..028ad48d55 100644 --- a/wp-includes/class-wp-locale-switcher.php +++ b/wp-includes/class-wp-locale-switcher.php @@ -12,6 +12,7 @@ * * @since 4.7.0 */ +#[AllowDynamicProperties] class WP_Locale_Switcher { /** * Locale stack. diff --git a/wp-includes/class-wp-locale.php b/wp-includes/class-wp-locale.php index 962fc9f2ca..ca98f9d301 100644 --- a/wp-includes/class-wp-locale.php +++ b/wp-includes/class-wp-locale.php @@ -13,6 +13,7 @@ * @since 2.1.0 * @since 4.6.0 Moved to its own file from wp-includes/locale.php. */ +#[AllowDynamicProperties] class WP_Locale { /** * Stores the translated strings for the full weekday names. diff --git a/wp-includes/class-wp-matchesmapregex.php b/wp-includes/class-wp-matchesmapregex.php index cdb39077e2..558bd98667 100644 --- a/wp-includes/class-wp-matchesmapregex.php +++ b/wp-includes/class-wp-matchesmapregex.php @@ -11,6 +11,7 @@ * * @since 2.9.0 */ +#[AllowDynamicProperties] class WP_MatchesMapRegex { /** * store for matches diff --git a/wp-includes/class-wp-meta-query.php b/wp-includes/class-wp-meta-query.php index f66b2fac5f..41b5f02f08 100644 --- a/wp-includes/class-wp-meta-query.php +++ b/wp-includes/class-wp-meta-query.php @@ -19,6 +19,7 @@ * * @since 3.2.0 */ +#[AllowDynamicProperties] class WP_Meta_Query { /** * Array of metadata queries. diff --git a/wp-includes/class-wp-metadata-lazyloader.php b/wp-includes/class-wp-metadata-lazyloader.php index 67eacc99ae..4a03633de0 100644 --- a/wp-includes/class-wp-metadata-lazyloader.php +++ b/wp-includes/class-wp-metadata-lazyloader.php @@ -28,6 +28,7 @@ * * @since 4.5.0 */ +#[AllowDynamicProperties] class WP_Metadata_Lazyloader { /** * Pending objects queue. diff --git a/wp-includes/class-wp-network-query.php b/wp-includes/class-wp-network-query.php index 269b960303..4f8a2a3a2e 100644 --- a/wp-includes/class-wp-network-query.php +++ b/wp-includes/class-wp-network-query.php @@ -14,6 +14,7 @@ * * @see WP_Network_Query::__construct() for accepted arguments. */ +#[AllowDynamicProperties] class WP_Network_Query { /** diff --git a/wp-includes/class-wp-network.php b/wp-includes/class-wp-network.php index f9dfad0957..75b407e541 100644 --- a/wp-includes/class-wp-network.php +++ b/wp-includes/class-wp-network.php @@ -21,6 +21,7 @@ * @property int $id * @property int $site_id */ +#[AllowDynamicProperties] class WP_Network { /** diff --git a/wp-includes/class-wp-object-cache.php b/wp-includes/class-wp-object-cache.php index c22fd6298d..6ca91a34fd 100644 --- a/wp-includes/class-wp-object-cache.php +++ b/wp-includes/class-wp-object-cache.php @@ -21,6 +21,7 @@ * * @since 2.0.0 */ +#[AllowDynamicProperties] class WP_Object_Cache { /** diff --git a/wp-includes/class-wp-oembed-controller.php b/wp-includes/class-wp-oembed-controller.php index 046c5c0a3a..22fceb54a9 100644 --- a/wp-includes/class-wp-oembed-controller.php +++ b/wp-includes/class-wp-oembed-controller.php @@ -15,6 +15,7 @@ * * @since 4.4.0 */ +#[AllowDynamicProperties] final class WP_oEmbed_Controller { /** * Register the oEmbed REST API route. diff --git a/wp-includes/class-wp-oembed.php b/wp-includes/class-wp-oembed.php index 58f5e484c4..ea666c1442 100644 --- a/wp-includes/class-wp-oembed.php +++ b/wp-includes/class-wp-oembed.php @@ -16,6 +16,7 @@ * * @since 2.9.0 */ +#[AllowDynamicProperties] class WP_oEmbed { /** diff --git a/wp-includes/class-wp-paused-extensions-storage.php b/wp-includes/class-wp-paused-extensions-storage.php index a2859d308f..4658277289 100644 --- a/wp-includes/class-wp-paused-extensions-storage.php +++ b/wp-includes/class-wp-paused-extensions-storage.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Paused_Extensions_Storage { /** diff --git a/wp-includes/class-wp-post-type.php b/wp-includes/class-wp-post-type.php index 3c3ec0e3ab..ab9fccc681 100644 --- a/wp-includes/class-wp-post-type.php +++ b/wp-includes/class-wp-post-type.php @@ -14,6 +14,7 @@ * * @see register_post_type() */ +#[AllowDynamicProperties] final class WP_Post_Type { /** * Post type key. diff --git a/wp-includes/class-wp-post.php b/wp-includes/class-wp-post.php index fe059d00aa..682b000f39 100644 --- a/wp-includes/class-wp-post.php +++ b/wp-includes/class-wp-post.php @@ -18,6 +18,7 @@ * @property-read int[] $post_category * @property-read string[] $tags_input */ +#[AllowDynamicProperties] final class WP_Post { /** diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 32b5fafaf3..4b17618907 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -15,6 +15,7 @@ * @since 1.5.0 * @since 4.5.0 Removed the `$comments_popup` property. */ +#[AllowDynamicProperties] class WP_Query { /** diff --git a/wp-includes/class-wp-recovery-mode-cookie-service.php b/wp-includes/class-wp-recovery-mode-cookie-service.php index 47329d6c64..df59b35780 100644 --- a/wp-includes/class-wp-recovery-mode-cookie-service.php +++ b/wp-includes/class-wp-recovery-mode-cookie-service.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] final class WP_Recovery_Mode_Cookie_Service { /** diff --git a/wp-includes/class-wp-recovery-mode-email-service.php b/wp-includes/class-wp-recovery-mode-email-service.php index e375f38bf1..013901f90e 100644 --- a/wp-includes/class-wp-recovery-mode-email-service.php +++ b/wp-includes/class-wp-recovery-mode-email-service.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] final class WP_Recovery_Mode_Email_Service { const RATE_LIMIT_OPTION = 'recovery_mode_email_last_sent'; diff --git a/wp-includes/class-wp-recovery-mode-key-service.php b/wp-includes/class-wp-recovery-mode-key-service.php index 6e533d04a9..5ab0f8c3f9 100644 --- a/wp-includes/class-wp-recovery-mode-key-service.php +++ b/wp-includes/class-wp-recovery-mode-key-service.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] final class WP_Recovery_Mode_Key_Service { /** diff --git a/wp-includes/class-wp-recovery-mode-link-service.php b/wp-includes/class-wp-recovery-mode-link-service.php index 1b4b96373a..4fb888c5d6 100644 --- a/wp-includes/class-wp-recovery-mode-link-service.php +++ b/wp-includes/class-wp-recovery-mode-link-service.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Recovery_Mode_Link_Service { const LOGIN_ACTION_ENTER = 'enter_recovery_mode'; const LOGIN_ACTION_ENTERED = 'entered_recovery_mode'; diff --git a/wp-includes/class-wp-recovery-mode.php b/wp-includes/class-wp-recovery-mode.php index e61290090e..b30eb408e3 100644 --- a/wp-includes/class-wp-recovery-mode.php +++ b/wp-includes/class-wp-recovery-mode.php @@ -11,6 +11,7 @@ * * @since 5.2.0 */ +#[AllowDynamicProperties] class WP_Recovery_Mode { const EXIT_ACTION = 'exit_recovery_mode'; diff --git a/wp-includes/class-wp-rewrite.php b/wp-includes/class-wp-rewrite.php index a1a262aa7b..a20de7128e 100644 --- a/wp-includes/class-wp-rewrite.php +++ b/wp-includes/class-wp-rewrite.php @@ -22,6 +22,7 @@ * * @since 1.5.0 */ +#[AllowDynamicProperties] class WP_Rewrite { /** * Permalink structure for posts. diff --git a/wp-includes/class-wp-role.php b/wp-includes/class-wp-role.php index 33f484ac97..6f25c3cb03 100644 --- a/wp-includes/class-wp-role.php +++ b/wp-includes/class-wp-role.php @@ -12,6 +12,7 @@ * * @since 2.0.0 */ +#[AllowDynamicProperties] class WP_Role { /** * Role name. diff --git a/wp-includes/class-wp-roles.php b/wp-includes/class-wp-roles.php index 23d5d76723..f224250fa2 100644 --- a/wp-includes/class-wp-roles.php +++ b/wp-includes/class-wp-roles.php @@ -23,6 +23,7 @@ * * @since 2.0.0 */ +#[AllowDynamicProperties] class WP_Roles { /** * List of roles and capabilities. diff --git a/wp-includes/class-wp-session-tokens.php b/wp-includes/class-wp-session-tokens.php index a1a779b236..feabf698b7 100644 --- a/wp-includes/class-wp-session-tokens.php +++ b/wp-includes/class-wp-session-tokens.php @@ -12,6 +12,7 @@ * * @since 4.0.0 */ +#[AllowDynamicProperties] abstract class WP_Session_Tokens { /** diff --git a/wp-includes/class-wp-simplepie-file.php b/wp-includes/class-wp-simplepie-file.php index 83cc324863..a0125aaf1d 100644 --- a/wp-includes/class-wp-simplepie-file.php +++ b/wp-includes/class-wp-simplepie-file.php @@ -17,6 +17,7 @@ * * @see SimplePie_File */ +#[AllowDynamicProperties] class WP_SimplePie_File extends SimplePie_File { /** diff --git a/wp-includes/class-wp-simplepie-sanitize-kses.php b/wp-includes/class-wp-simplepie-sanitize-kses.php index 183fe07ca7..4e7602cda4 100644 --- a/wp-includes/class-wp-simplepie-sanitize-kses.php +++ b/wp-includes/class-wp-simplepie-sanitize-kses.php @@ -17,6 +17,7 @@ * * @see SimplePie_Sanitize */ +#[AllowDynamicProperties] class WP_SimplePie_Sanitize_KSES extends SimplePie_Sanitize { /** diff --git a/wp-includes/class-wp-site-query.php b/wp-includes/class-wp-site-query.php index b620713989..a90cc9de8d 100644 --- a/wp-includes/class-wp-site-query.php +++ b/wp-includes/class-wp-site-query.php @@ -14,6 +14,7 @@ * * @see WP_Site_Query::__construct() for accepted arguments. */ +#[AllowDynamicProperties] class WP_Site_Query { /** diff --git a/wp-includes/class-wp-site.php b/wp-includes/class-wp-site.php index 1e253ec636..fcd07cd5e3 100644 --- a/wp-includes/class-wp-site.php +++ b/wp-includes/class-wp-site.php @@ -22,6 +22,7 @@ * @property int $post_count * @property string $home */ +#[AllowDynamicProperties] final class WP_Site { /** diff --git a/wp-includes/class-wp-tax-query.php b/wp-includes/class-wp-tax-query.php index 9f4aeaaa76..e7b1e2a95a 100644 --- a/wp-includes/class-wp-tax-query.php +++ b/wp-includes/class-wp-tax-query.php @@ -19,6 +19,7 @@ * * @since 3.1.0 */ +#[AllowDynamicProperties] class WP_Tax_Query { /** diff --git a/wp-includes/class-wp-taxonomy.php b/wp-includes/class-wp-taxonomy.php index 0fac7a0501..1f7eed96f6 100644 --- a/wp-includes/class-wp-taxonomy.php +++ b/wp-includes/class-wp-taxonomy.php @@ -12,6 +12,7 @@ * * @since 4.7.0 */ +#[AllowDynamicProperties] final class WP_Taxonomy { /** * Taxonomy key. diff --git a/wp-includes/class-wp-term-query.php b/wp-includes/class-wp-term-query.php index 5c430c8459..18c85e89b2 100644 --- a/wp-includes/class-wp-term-query.php +++ b/wp-includes/class-wp-term-query.php @@ -15,6 +15,7 @@ * * @see WP_Term_Query::__construct() for accepted arguments. */ +#[AllowDynamicProperties] class WP_Term_Query { /** diff --git a/wp-includes/class-wp-term.php b/wp-includes/class-wp-term.php index f79ab8633b..0f5631353e 100644 --- a/wp-includes/class-wp-term.php +++ b/wp-includes/class-wp-term.php @@ -14,6 +14,7 @@ * * @property-read object $data Sanitized term data. */ +#[AllowDynamicProperties] final class WP_Term { /** diff --git a/wp-includes/class-wp-text-diff-renderer-inline.php b/wp-includes/class-wp-text-diff-renderer-inline.php index 62a33033e3..eaba1b61ed 100644 --- a/wp-includes/class-wp-text-diff-renderer-inline.php +++ b/wp-includes/class-wp-text-diff-renderer-inline.php @@ -13,6 +13,7 @@ * @since 2.6.0 * @uses Text_Diff_Renderer_inline Extends */ +#[AllowDynamicProperties] class WP_Text_Diff_Renderer_inline extends Text_Diff_Renderer_inline { /** diff --git a/wp-includes/class-wp-text-diff-renderer-table.php b/wp-includes/class-wp-text-diff-renderer-table.php index 43c0d0e422..a74b8019f4 100644 --- a/wp-includes/class-wp-text-diff-renderer-table.php +++ b/wp-includes/class-wp-text-diff-renderer-table.php @@ -13,6 +13,7 @@ * @since 2.6.0 * @uses Text_Diff_Renderer Extends */ +#[AllowDynamicProperties] class WP_Text_Diff_Renderer_Table extends Text_Diff_Renderer { /** diff --git a/wp-includes/class-wp-textdomain-registry.php b/wp-includes/class-wp-textdomain-registry.php index d4d8968ac9..403fff9813 100644 --- a/wp-includes/class-wp-textdomain-registry.php +++ b/wp-includes/class-wp-textdomain-registry.php @@ -12,6 +12,7 @@ * * @since 6.1.0 */ +#[AllowDynamicProperties] class WP_Textdomain_Registry { /** * List of domains and all their language directory paths for each locale. diff --git a/wp-includes/class-wp-theme-json-resolver.php b/wp-includes/class-wp-theme-json-resolver.php index c9bb42cac5..cf5ffa2e2b 100644 --- a/wp-includes/class-wp-theme-json-resolver.php +++ b/wp-includes/class-wp-theme-json-resolver.php @@ -17,6 +17,7 @@ * * @access private */ +#[AllowDynamicProperties] class WP_Theme_JSON_Resolver { /** diff --git a/wp-includes/class-wp-theme-json-schema.php b/wp-includes/class-wp-theme-json-schema.php index 462af76376..2e35a12c2b 100644 --- a/wp-includes/class-wp-theme-json-schema.php +++ b/wp-includes/class-wp-theme-json-schema.php @@ -17,6 +17,7 @@ * @since 5.9.0 * @access private */ +#[AllowDynamicProperties] class WP_Theme_JSON_Schema { /** diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index 69a349f970..e5eb5a7391 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -16,6 +16,7 @@ * * @access private */ +#[AllowDynamicProperties] class WP_Theme_JSON { /** diff --git a/wp-includes/class-wp-theme.php b/wp-includes/class-wp-theme.php index 55a9359a13..84e7d1f571 100644 --- a/wp-includes/class-wp-theme.php +++ b/wp-includes/class-wp-theme.php @@ -6,6 +6,7 @@ * @subpackage Theme * @since 3.4.0 */ +#[AllowDynamicProperties] final class WP_Theme implements ArrayAccess { /** diff --git a/wp-includes/class-wp-user-query.php b/wp-includes/class-wp-user-query.php index f894027e67..330882494e 100644 --- a/wp-includes/class-wp-user-query.php +++ b/wp-includes/class-wp-user-query.php @@ -14,6 +14,7 @@ * * @see WP_User_Query::prepare_query() for information on accepted arguments. */ +#[AllowDynamicProperties] class WP_User_Query { /** diff --git a/wp-includes/class-wp-user-request.php b/wp-includes/class-wp-user-request.php index 7e445cfa63..8c66dcdf81 100644 --- a/wp-includes/class-wp-user-request.php +++ b/wp-includes/class-wp-user-request.php @@ -6,6 +6,7 @@ * * @since 4.9.6 */ +#[AllowDynamicProperties] final class WP_User_Request { /** * Request ID. diff --git a/wp-includes/class-wp-user.php b/wp-includes/class-wp-user.php index 45878986f7..b190960009 100644 --- a/wp-includes/class-wp-user.php +++ b/wp-includes/class-wp-user.php @@ -36,6 +36,7 @@ * @property string $syntax_highlighting * @property string $use_ssl */ +#[AllowDynamicProperties] class WP_User { /** * User data container. diff --git a/wp-includes/class-wp-walker.php b/wp-includes/class-wp-walker.php index d47d25261f..f7f4715ed1 100644 --- a/wp-includes/class-wp-walker.php +++ b/wp-includes/class-wp-walker.php @@ -11,6 +11,7 @@ * @package WordPress * @abstract */ +#[AllowDynamicProperties] class Walker { /** * What the class handles. diff --git a/wp-includes/class-wp-widget-factory.php b/wp-includes/class-wp-widget-factory.php index a7554846a2..ed719b9d4d 100644 --- a/wp-includes/class-wp-widget-factory.php +++ b/wp-includes/class-wp-widget-factory.php @@ -13,6 +13,7 @@ * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php */ +#[AllowDynamicProperties] class WP_Widget_Factory { /** diff --git a/wp-includes/class-wp-widget.php b/wp-includes/class-wp-widget.php index 086e9e9ffb..79a1efe1bf 100644 --- a/wp-includes/class-wp-widget.php +++ b/wp-includes/class-wp-widget.php @@ -17,6 +17,7 @@ * @since 2.8.0 * @since 4.4.0 Moved to its own file from wp-includes/widgets.php */ +#[AllowDynamicProperties] class WP_Widget { /** diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index f48f4a01f5..6e3ee0a13a 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -20,6 +20,7 @@ * * @see IXR_Server */ +#[AllowDynamicProperties] class wp_xmlrpc_server extends IXR_Server { /** * Methods. diff --git a/wp-includes/class-wp.php b/wp-includes/class-wp.php index ca9399e4e5..8d67820545 100644 --- a/wp-includes/class-wp.php +++ b/wp-includes/class-wp.php @@ -5,6 +5,7 @@ * @package WordPress * @since 2.0.0 */ +#[AllowDynamicProperties] class WP { /** * Public query variables. diff --git a/wp-includes/class-wpdb.php b/wp-includes/class-wpdb.php index 81a43900f5..e81b9caf79 100644 --- a/wp-includes/class-wpdb.php +++ b/wp-includes/class-wpdb.php @@ -51,6 +51,7 @@ define( 'ARRAY_N', 'ARRAY_N' ); * * @since 0.71 */ +#[AllowDynamicProperties] class wpdb { /** diff --git a/wp-includes/class.wp-dependencies.php b/wp-includes/class.wp-dependencies.php index c527715a63..1deb9a41fb 100644 --- a/wp-includes/class.wp-dependencies.php +++ b/wp-includes/class.wp-dependencies.php @@ -15,6 +15,7 @@ * * @see _WP_Dependency */ +#[AllowDynamicProperties] class WP_Dependencies { /** * An array of all registered dependencies keyed by handle. diff --git a/wp-includes/customize/class-wp-customize-partial.php b/wp-includes/customize/class-wp-customize-partial.php index f75ac43945..06502bec11 100644 --- a/wp-includes/customize/class-wp-customize-partial.php +++ b/wp-includes/customize/class-wp-customize-partial.php @@ -16,6 +16,7 @@ * * @since 4.5.0 */ +#[AllowDynamicProperties] class WP_Customize_Partial { /** diff --git a/wp-includes/customize/class-wp-customize-selective-refresh.php b/wp-includes/customize/class-wp-customize-selective-refresh.php index e5e3bcbba5..6119e68944 100644 --- a/wp-includes/customize/class-wp-customize-selective-refresh.php +++ b/wp-includes/customize/class-wp-customize-selective-refresh.php @@ -12,6 +12,7 @@ * * @since 4.5.0 */ +#[AllowDynamicProperties] final class WP_Customize_Selective_Refresh { /** diff --git a/wp-includes/pomo/entry.php b/wp-includes/pomo/entry.php index 55ff28680e..97ffe46b7b 100644 --- a/wp-includes/pomo/entry.php +++ b/wp-includes/pomo/entry.php @@ -11,6 +11,7 @@ if ( ! class_exists( 'Translation_Entry', false ) ) : /** * Translation_Entry class encapsulates a translatable string. */ + #[AllowDynamicProperties] class Translation_Entry { /** diff --git a/wp-includes/pomo/plural-forms.php b/wp-includes/pomo/plural-forms.php index 2ed0c62ebf..b072bfadac 100644 --- a/wp-includes/pomo/plural-forms.php +++ b/wp-includes/pomo/plural-forms.php @@ -6,6 +6,7 @@ * @since 4.9.0 */ if ( ! class_exists( 'Plural_Forms', false ) ) : + #[AllowDynamicProperties] class Plural_Forms { /** * Operator characters. diff --git a/wp-includes/pomo/streams.php b/wp-includes/pomo/streams.php index 4f836961f4..5c1a95a2ed 100644 --- a/wp-includes/pomo/streams.php +++ b/wp-includes/pomo/streams.php @@ -9,6 +9,7 @@ */ if ( ! class_exists( 'POMO_Reader', false ) ) : + #[AllowDynamicProperties] class POMO_Reader { public $endian = 'little'; diff --git a/wp-includes/pomo/translations.php b/wp-includes/pomo/translations.php index 6a69ebdb3b..8ebcbaa8d2 100644 --- a/wp-includes/pomo/translations.php +++ b/wp-includes/pomo/translations.php @@ -11,6 +11,7 @@ require_once __DIR__ . '/plural-forms.php'; require_once __DIR__ . '/entry.php'; if ( ! class_exists( 'Translations', false ) ) : + #[AllowDynamicProperties] class Translations { public $entries = array(); public $headers = array(); @@ -314,6 +315,7 @@ if ( ! class_exists( 'NOOP_Translations', false ) ) : /** * Provides the same interface as Translations, but doesn't do anything */ + #[AllowDynamicProperties] class NOOP_Translations { public $entries = array(); public $headers = array(); diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 87689a94a5..b93bd36857 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -26,6 +26,7 @@ * * @link https://www.php.net/manual/en/class.arrayaccess.php */ +#[AllowDynamicProperties] class WP_REST_Request implements ArrayAccess { /** diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index ede83bdb19..ddb3f6c01b 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -12,6 +12,7 @@ * * @since 4.4.0 */ +#[AllowDynamicProperties] class WP_REST_Server { /** diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index 982376cb2f..61591cb6c1 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -12,6 +12,7 @@ * * @since 4.7.0 */ +#[AllowDynamicProperties] abstract class WP_REST_Controller { /** diff --git a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php index f186648545..1b6a7fe37f 100644 --- a/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php +++ b/wp-includes/rest-api/fields/class-wp-rest-meta-fields.php @@ -12,6 +12,7 @@ * * @since 4.7.0 */ +#[AllowDynamicProperties] abstract class WP_REST_Meta_Fields { /** diff --git a/wp-includes/rest-api/search/class-wp-rest-search-handler.php b/wp-includes/rest-api/search/class-wp-rest-search-handler.php index b2aa64e916..34ba2f1c08 100644 --- a/wp-includes/rest-api/search/class-wp-rest-search-handler.php +++ b/wp-includes/rest-api/search/class-wp-rest-search-handler.php @@ -12,6 +12,7 @@ * * @since 5.0.0 */ +#[AllowDynamicProperties] abstract class WP_REST_Search_Handler { /** diff --git a/wp-includes/sitemaps/class-wp-sitemaps-index.php b/wp-includes/sitemaps/class-wp-sitemaps-index.php index 10348494f3..940358823f 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-index.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-index.php @@ -15,6 +15,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Sitemaps_Index { /** * The main registry of supported sitemaps. diff --git a/wp-includes/sitemaps/class-wp-sitemaps-provider.php b/wp-includes/sitemaps/class-wp-sitemaps-provider.php index 415ce66ebc..81464c1bdb 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-provider.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-provider.php @@ -14,6 +14,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] abstract class WP_Sitemaps_Provider { /** * Provider name. diff --git a/wp-includes/sitemaps/class-wp-sitemaps-registry.php b/wp-includes/sitemaps/class-wp-sitemaps-registry.php index 6edf1dfe5c..4775ae5da1 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-registry.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-registry.php @@ -14,6 +14,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Sitemaps_Registry { /** * Registered sitemap providers. diff --git a/wp-includes/sitemaps/class-wp-sitemaps-renderer.php b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php index 0069b11126..11d5c3820a 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-renderer.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-renderer.php @@ -14,6 +14,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Sitemaps_Renderer { /** * XSL stylesheet for styling a sitemap for web browsers. diff --git a/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php index 3051900065..8268fcc924 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php +++ b/wp-includes/sitemaps/class-wp-sitemaps-stylesheet.php @@ -14,6 +14,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Sitemaps_Stylesheet { /** * Renders the XSL stylesheet depending on whether it's the sitemap index or not. diff --git a/wp-includes/sitemaps/class-wp-sitemaps.php b/wp-includes/sitemaps/class-wp-sitemaps.php index 2e96e48ed2..cd8d1e4dbc 100644 --- a/wp-includes/sitemaps/class-wp-sitemaps.php +++ b/wp-includes/sitemaps/class-wp-sitemaps.php @@ -14,6 +14,7 @@ * * @since 5.5.0 */ +#[AllowDynamicProperties] class WP_Sitemaps { /** * The main index of supported sitemaps. diff --git a/wp-includes/version.php b/wp-includes/version.php index e3d8ab83d4..c304864534 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-alpha-54132'; +$wp_version = '6.1-alpha-54133'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.