PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 14.4
Jetpack – WP Security, Backup, Speed, & Growth v14.4
16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 13.8.3 13.9.2 14.0.1 14.1.1 14.2.2 14.3.1 All 501 releases
jetpack / modules / blocks.php
blocks.php
47 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Module Name: Blocks
4 * Module Description: Add additional blocks to your site and post editors.
5 * Sort Order: 5
6 * First Introduced: 13.9-a.8
7 * Requires Connection: No
8 * Auto Activate: Yes
9 * Module Tags: blocks
10 * Feature: Writing
11 *
12 * @package automattic/jetpack
13 */
14
15 add_action( 'jetpack_activate_module_blocks', 'jetpack_blocks_activate_module' );
16
17 /**
18 * Actions needed upon activating the blocks module.
19 *
20 * There is a legacy option to disable Jetpack blocks that we'll delete when this module is activated.
21 * Via jetpack_get_default_modules filter, we remove blocks from the default if the option is true.
22 * We'll leave that in place so _until the module is activated_ we will be sure to respect the previous
23 * setting.
24 *
25 * @since 13.9
26 * @return void
27 */
28 function jetpack_blocks_activate_module() {
29 delete_option( 'jetpack_blocks_disabled' ); // The function will check and return early if not present.
30 }
31
32 Jetpack_Gutenberg::load_block_editor_extensions();
33 Jetpack_Gutenberg::load_independent_blocks();
34 Jetpack_Gutenberg::register_block_metadata_collection();
35
36 /**
37 * We've switched from enqueue_block_editor_assets to enqueue_block_assets in WP-Admin because the assets with the former are loaded on the main site-editor.php.
38 *
39 * With the latter, the assets are now loaded in the SE iframe; the implementation is now faster because Gutenberg doesn't need to inject the assets in the iframe on client-side.
40 */
41 if ( is_admin() ) {
42 add_action( 'enqueue_block_assets', array( 'Jetpack_Gutenberg', 'enqueue_block_editor_assets' ) );
43 } else {
44 add_action( 'enqueue_block_editor_assets', array( 'Jetpack_Gutenberg', 'enqueue_block_editor_assets' ) );
45 }
46 add_filter( 'render_block', array( 'Jetpack_Gutenberg', 'display_deprecated_block_message' ), 10, 2 );
47