|
@@ 376-380 (lines=5) @@
|
| 373 |
|
$type = sanitize_title_with_dashes( $type ); |
| 374 |
|
// Enqueue styles. |
| 375 |
|
$style_relative_path = self::get_blocks_directory() . $type . '/view' . ( is_rtl() ? '.rtl' : '' ) . '.css'; |
| 376 |
|
if ( self::block_has_asset( $style_relative_path ) ) { |
| 377 |
|
$style_version = self::get_asset_version( $style_relative_path ); |
| 378 |
|
$view_style = plugins_url( $style_relative_path, JETPACK__PLUGIN_FILE ); |
| 379 |
|
wp_enqueue_style( 'jetpack-block-' . $type, $view_style, array(), $style_version ); |
| 380 |
|
} |
| 381 |
|
|
| 382 |
|
// Enqueue script. |
| 383 |
|
$script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
|
@@ 384-388 (lines=5) @@
|
| 381 |
|
|
| 382 |
|
// Enqueue script. |
| 383 |
|
$script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
| 384 |
|
if ( self::block_has_asset( $script_relative_path ) ) { |
| 385 |
|
$script_version = self::get_asset_version( $script_relative_path ); |
| 386 |
|
$view_script = plugins_url( $script_relative_path, JETPACK__PLUGIN_FILE ); |
| 387 |
|
wp_enqueue_script( 'jetpack-block-' . $type, $view_script, $script_dependencies, $script_version, false ); |
| 388 |
|
} |
| 389 |
|
|
| 390 |
|
wp_localize_script( |
| 391 |
|
'jetpack-block-' . $type, |