← All changes
|
jetpack_vendor/automattic/jetpack-publicize/src/class-publicize-assets.php
+3
-11
16.2
→
16.3
View file →
| @@ -74,20 +74,12 @@ | ||
| 74 | 74 | ); |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | /** |
| 78 | - * Register polyfills for the wp-theme / wp-private-apis / wp-rich-text handles the | |
| 79 | - * Social bundles depend on but WP < 7.0 does not ship (or ships with an incomplete | |
| 80 | - * allowlist). | |
| 78 | + * Register the wp-build polyfills Social's block editor bundles request. | |
| 81 | 79 | * |
| 82 | - * `wp-rich-text` is needed because the editor bundles reach `@wordpress/dataviews` | |
| 83 | - * (via `@wordpress/ui`), whose dataform controls unlock rich-text's `privateApis` at | |
| 84 | - * module scope. WP 6.9 exports none, so without the polyfill the bundle throws | |
| 85 | - * "Cannot unlock an undefined object" before the sidebar renders. | |
| 86 | - * | |
| 87 | - * Only the handles Social actually uses are requested, to keep the polyfill's | |
| 88 | - * force-replacement off any handle we don't need — `wp-notices` in particular, which | |
| 89 | - * Core registers adequately for these bundles. | |
| 80 | + * Runs only where enqueue_block_editor_scripts() loads those bundles, as the editor has no `page` slug | |
| 81 | + * to gate on. Keep it there: below WP 7.1 it can replace Core's wp-private-apis and wp-rich-text editor-wide. | |
| 90 | 82 | */ |
| 91 | 83 | public static function register_wp_build_polyfills() { |
| 92 | 84 | if ( ! class_exists( WP_Build_Polyfills::class ) ) { |
| 93 | 85 | return; |