@@ 42-61 (lines=20) @@ | ||
39 | * |
|
40 | * @param bool false Whether to load Gutenberg blocks from CDN |
|
41 | */ |
|
42 | if ( apply_filters( 'jetpack_gutenberg_cdn', false ) ) { |
|
43 | $cdn_base = 'https://s0.wp.com/wp-content/mu-plugins/jetpack/_inc/blocks'; |
|
44 | $view_script = "$cdn_base/view.js"; |
|
45 | $view_style = "$cdn_base/view$rtl.css"; |
|
46 | ||
47 | /** |
|
48 | * Filter to modify cache busting for Gutenberg block assets loaded from CDN |
|
49 | * |
|
50 | * @since 6.5.0 |
|
51 | * |
|
52 | * @param string |
|
53 | */ |
|
54 | $version = apply_filters( 'jetpack_gutenberg_cdn_cache_buster', sprintf( '%s-%s', gmdate( 'd-m-Y' ), JETPACK__VERSION ) ); |
|
55 | } else { |
|
56 | $view_script = plugins_url( '_inc/blocks/view.js', JETPACK__PLUGIN_FILE ); |
|
57 | $view_style = plugins_url( "_inc/blocks/view$rtl.css", JETPACK__PLUGIN_FILE ); |
|
58 | $version = Jetpack::is_development_version() && file_exists( JETPACK__PLUGIN_DIR . '_inc/blocks/view.js' ) |
|
59 | ? filemtime( JETPACK__PLUGIN_DIR . '_inc/blocks/view.js' ) |
|
60 | : JETPACK__VERSION; |
|
61 | } |
|
62 | ||
63 | wp_enqueue_script( |
|
64 | 'jetpack-blocks-view', |
|
@@ 93-112 (lines=20) @@ | ||
90 | $rtl = is_rtl() ? '.rtl' : ''; |
|
91 | ||
92 | /** This filter is already documented above */ |
|
93 | if ( apply_filters( 'jetpack_gutenberg_cdn', false ) ) { |
|
94 | $cdn_base = 'https://s0.wp.com/wp-content/mu-plugins/jetpack/_inc/blocks'; |
|
95 | $editor_script = "$cdn_base/editor.js"; |
|
96 | $editor_style = "$cdn_base/editor$rtl.css"; |
|
97 | ||
98 | /** This filter is already documented above */ |
|
99 | $version = apply_filters( 'jetpack_gutenberg_cdn_cache_buster', sprintf( '%s-%s', gmdate( 'd-m-Y' ), JETPACK__VERSION ) ); |
|
100 | } else { |
|
101 | $editor_script = plugins_url( '_inc/blocks/editor.js', JETPACK__PLUGIN_FILE ); |
|
102 | $editor_style = plugins_url( "_inc/blocks/editor$rtl.css", JETPACK__PLUGIN_FILE ); |
|
103 | $version = Jetpack::is_development_version() && file_exists( JETPACK__PLUGIN_DIR . '_inc/blocks/editor.js' ) |
|
104 | ? filemtime( JETPACK__PLUGIN_DIR . '_inc/blocks/editor.js' ) |
|
105 | : JETPACK__VERSION; |
|
106 | } |
|
107 | ||
108 | wp_enqueue_script( |
|
109 | 'jetpack-blocks-editor', |
|
110 | $editor_script, |
|
111 | array( |
|
112 | 'lodash', |
|
113 | 'wp-api-fetch', |
|
114 | 'wp-blocks', |
|
115 | 'wp-components', |