diff --git a/platforms/wordpress/templates/Template_Basic_Component.php b/platforms/wordpress/templates/Template_Basic_Component.php index 777a2c9..f94185a 100644 --- a/platforms/wordpress/templates/Template_Basic_Component.php +++ b/platforms/wordpress/templates/Template_Basic_Component.php @@ -2,8 +2,6 @@ namespace AXEWEB_Blocks\Blocks\<%= ownerClass %>\<%= blockClassModel %>; -use Core\Global_Functions; - class <%= blockClassModel %>_Component { public function __construct() { @@ -12,17 +10,20 @@ class <%= blockClassModel %>_Component { } function register_assets(): void { + // $version = get_plugin_data( __DIR__ . "/../../scytale-custom-blocks.php" )['Version']; // In Plugins + $version = \Core\Global_Functions::get_current_version_number(); // In Theme + wp_register_style( '<%= blockFilename %>', get_template_directory_uri() . '/components/partials/<%= blockFilename %>/templates/styles/<%= blockFilename %>.min.css', [ 'style-wp' ], - Global_Functions::get_current_version_number() + $version ); wp_enqueue_style( '<%= blockFilename %>' ); wp_register_script( 'script-<%= blockFilename %>', get_template_directory_uri() . '/components/partials/<%= blockFilename %>/templates/scripts/<%= blockFilename %>.min.js', [ 'jquery', 'swiper' ], - Global_Functions::get_current_version_number(), + $version, true ); wp_enqueue_script( 'script-<%= blockFilename %>' );