|
@@ 440-444 (lines=5) @@
|
| 437 |
|
$type = sanitize_title_with_dashes( $type ); |
| 438 |
|
// Enqueue styles. |
| 439 |
|
$style_relative_path = self::get_blocks_directory() . $type . '/view' . ( is_rtl() ? '.rtl' : '' ) . '.css'; |
| 440 |
|
if ( self::block_has_asset( $style_relative_path ) ) { |
| 441 |
|
$style_version = self::get_asset_version( $style_relative_path ); |
| 442 |
|
$view_style = plugins_url( $style_relative_path, JETPACK__PLUGIN_FILE ); |
| 443 |
|
wp_enqueue_style( 'jetpack-block-' . $type, $view_style, array(), $style_version ); |
| 444 |
|
} |
| 445 |
|
|
| 446 |
|
// Enqueue script. |
| 447 |
|
$script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
|
@@ 448-452 (lines=5) @@
|
| 445 |
|
|
| 446 |
|
// Enqueue script. |
| 447 |
|
$script_relative_path = self::get_blocks_directory() . $type . '/view.js'; |
| 448 |
|
if ( self::block_has_asset( $script_relative_path ) ) { |
| 449 |
|
$script_version = self::get_asset_version( $script_relative_path ); |
| 450 |
|
$view_script = plugins_url( $script_relative_path, JETPACK__PLUGIN_FILE ); |
| 451 |
|
wp_enqueue_script( 'jetpack-block-' . $type, $view_script, $script_dependencies, $script_version, false ); |
| 452 |
|
} |
| 453 |
|
|
| 454 |
|
wp_localize_script( |
| 455 |
|
'jetpack-block-' . $type, |