Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 1 |
| Verbum_Asset_Loader | |
0.00% |
0 / 17 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 1 |
| load_editor_supporting_assets | |
0.00% |
0 / 8 |
|
0.00% |
0 / 1 |
2 | |||
| load_editor | |
0.00% |
0 / 9 |
|
0.00% |
0 / 1 |
2 | |||
| 1 | <?php |
| 2 | /** |
| 3 | * Verbum Asset Loader. |
| 4 | * |
| 5 | * @package automattic/jetpack-mu-wpcom |
| 6 | */ |
| 7 | |
| 8 | declare( strict_types = 1 ); |
| 9 | |
| 10 | /** |
| 11 | * Verbum_Asset_Loader is responsible for loading the Verbum Gutenberg editor. |
| 12 | */ |
| 13 | class Verbum_Asset_Loader { |
| 14 | |
| 15 | /** |
| 16 | * Load supporting assets for the Verbum Gutenberg editor. |
| 17 | */ |
| 18 | public static function load_editor_supporting_assets() { |
| 19 | $vbe_cache_buster = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/build_meta.json' ); |
| 20 | |
| 21 | wp_enqueue_style( |
| 22 | 'verbum-gutenberg-css', |
| 23 | 'https://widgets.wp.com/verbum-block-editor/block-editor.css', |
| 24 | array(), |
| 25 | $vbe_cache_buster |
| 26 | ); |
| 27 | |
| 28 | // phpcs:ignore Jetpack.Functions.I18n.TextDomainMismatch |
| 29 | wp_set_script_translations( 'verbum', 'default', ABSPATH . 'widgets.wp.com/verbum-block-editor/languages/' ); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * Load the complete Verbum Gutenberg editor. |
| 34 | */ |
| 35 | public static function load_editor() { |
| 36 | |
| 37 | $vbe_cache_buster = filemtime( ABSPATH . '/widgets.wp.com/verbum-block-editor/build_meta.json' ); |
| 38 | |
| 39 | wp_enqueue_script( |
| 40 | 'verbum', |
| 41 | 'https://widgets.wp.com/verbum-block-editor/block-editor.min.js', |
| 42 | array(), |
| 43 | $vbe_cache_buster, |
| 44 | true |
| 45 | ); |
| 46 | |
| 47 | self::load_editor_supporting_assets(); |
| 48 | } |
| 49 | } |