lib
block-supports
4 months ago
compat
3 months ago
experimental
3 months ago
media
3 months ago
README.md
10.0 KB
7 months ago
block-editor-settings.php
5.4 KB
7 months ago
block-template-utils.php
3.5 KB
1 year ago
blocks.php
11.8 KB
7 months ago
class-wp-duotone-gutenberg.php
37.6 KB
5 months ago
class-wp-icons-registry-gutenberg.php
7.1 KB
4 months ago
class-wp-rest-edit-site-export-controller-gutenberg.php
1.2 KB
2 years ago
class-wp-rest-global-styles-controller-gutenberg.php
24.5 KB
7 months ago
class-wp-rest-icons-controller-gutenberg.php
481 B
4 months ago
class-wp-theme-json-data-gutenberg.php
1.7 KB
2 years ago
class-wp-theme-json-gutenberg.php
196.1 KB
3 months ago
class-wp-theme-json-resolver-gutenberg.php
34.7 KB
6 months ago
class-wp-theme-json-schema-gutenberg.php
7.4 KB
7 months ago
client-assets.php
16.4 KB
4 months ago
demo.php
1.6 KB
1 year ago
global-styles-and-settings.php
14.2 KB
7 months ago
init.php
945 B
4 months ago
interactivity-api.php
1.2 KB
7 months ago
load.php
10.9 KB
3 months ago
mathml-kses.php
6.3 KB
10 months ago
overlay-patterns.php
12.2 KB
6 months ago
remove-core-enqueue-scripts.php
779 B
5 months ago
rest-api.php
1.6 KB
4 months ago
script-loader.php
5.9 KB
5 months ago
theme-i18n.json
1.8 KB
7 months ago
theme.json
9.2 KB
5 months ago
upgrade.php
2.6 KB
5 months ago
interactivity-api.php in Gutenberg 23.2.0, at lib/interactivity-api.php
| 1 | <?php |
| 2 | /** |
| 3 | * Interactivity API functions specific for the Gutenberg editor plugin. |
| 4 | * |
| 5 | * @package gutenberg |
| 6 | */ |
| 7 | |
| 8 | /** |
| 9 | * Adds script data to the interactivity-router script module. |
| 10 | * |
| 11 | * This filter is registered conditionally anticipating a WordPress Core change to add the script module data. |
| 12 | * The filter runs on 'after_setup_theme' (when Core registers Interactivity and Script Modules hooks) |
| 13 | * to ensure that the conditional registration happens after Core and correctly determine whether |
| 14 | * the filter should be added. |
| 15 | * |
| 16 | * @link https://github.com/WordPress/wordpress-develop/pull/7304 |
| 17 | */ |
| 18 | function gutenberg_register_interactivity_script_module_data_hooks() { |
| 19 | if ( ! has_filter( 'script_module_data_@wordpress/interactivity-router', array( wp_interactivity(), 'filter_script_module_interactivity_router_data' ) ) ) { |
| 20 | add_filter( |
| 21 | 'script_module_data_@wordpress/interactivity-router', |
| 22 | function ( $data ) { |
| 23 | if ( ! isset( $data['i18n'] ) ) { |
| 24 | $data['i18n'] = array(); |
| 25 | } |
| 26 | $data['i18n']['loading'] = __( 'Loading page, please wait.', 'default' ); |
| 27 | $data['i18n']['loaded'] = __( 'Page Loaded.', 'default' ); |
| 28 | return $data; |
| 29 | } |
| 30 | ); |
| 31 | } |
| 32 | } |
| 33 | add_action( 'after_setup_theme', 'gutenberg_register_interactivity_script_module_data_hooks', 20 ); |
| 34 |