@@ 334-338 (lines=5) @@ | ||
331 | $type = sanitize_title_with_dashes( $type ); |
|
332 | // Enqueue styles. |
|
333 | $style_relative_path = self::get_blocks_directory() . $type . '/view' . ( is_rtl() ? '.rtl' : '' ) . '.css'; |
|
334 | if ( self::block_has_asset( $style_relative_path ) ) { |
|
335 | $style_version = self::get_asset_version( $style_relative_path ); |
|
336 | $view_style = plugins_url( $style_relative_path, JETPACK__PLUGIN_FILE ); |
|
337 | wp_enqueue_style( 'jetpack-block-' . $type, $view_style, array(), $style_version ); |
|
338 | } |
|
339 | ||
340 | // Enqueue script. |
|
341 | $script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
|
@@ 342-346 (lines=5) @@ | ||
339 | ||
340 | // Enqueue script. |
|
341 | $script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
|
342 | if ( self::block_has_asset( $script_relative_path ) ) { |
|
343 | $script_version = self::get_asset_version( $script_relative_path ); |
|
344 | $view_script = plugins_url( $script_relative_path, JETPACK__PLUGIN_FILE ); |
|
345 | wp_enqueue_script( 'jetpack-block-' . $type, $view_script, $script_dependencies, $script_version, false ); |
|
346 | } |
|
347 | ||
348 | wp_localize_script( |
|
349 | 'jetpack-block-' . $type, |