Browse Source

Update path to assets.

pull/6/head
Roman Axelrod 3 years ago
parent
commit
9d25bdcb88
  1. 7
      platforms/wordpress/templates/Template_Basic_Component.php

7
platforms/wordpress/templates/Template_Basic_Component.php

@ -13,15 +13,18 @@ class <%= blockClassModel %>_Component {
// $version = get_plugin_data( __DIR__ . "/../../scytale-custom-blocks.php" )['Version']; // In Plugins // $version = get_plugin_data( __DIR__ . "/../../scytale-custom-blocks.php" )['Version']; // In Plugins
$version = \Core\Global_Functions::get_current_version_number(); // In Theme $version = \Core\Global_Functions::get_current_version_number(); // In Theme
// $base_path = plugin_dir_url( __FILE__ ); // In Plugins
$base_path = get_template_directory_uri() . '/components/partials/<%= blockFilename %>/';
wp_register_style( '<%= blockFilename %>', wp_register_style( '<%= blockFilename %>',
get_template_directory_uri() . '/components/partials/<%= blockFilename %>/templates/styles/<%= blockFilename %>.min.css', $base_path . 'templates/styles/<%= blockFilename %>.min.css',
[ 'style-wp' ], [ 'style-wp' ],
$version $version
); );
wp_enqueue_style( '<%= blockFilename %>' ); wp_enqueue_style( '<%= blockFilename %>' );
wp_register_script( 'script-<%= blockFilename %>', wp_register_script( 'script-<%= blockFilename %>',
get_template_directory_uri() . '/components/partials/<%= blockFilename %>/templates/scripts/<%= blockFilename %>.min.js', $base_path . 'templates/scripts/<%= blockFilename %>.min.js',
[ 'jquery', 'swiper' ], [ 'jquery', 'swiper' ],
$version, $version,
true true

Loading…
Cancel
Save