Browse Source

Update WordPress Basic Template

test-gpt-generated
Roman Axelrod 3 years ago
parent
commit
00866a8115
  1. 9
      platforms/wordpress/templates/Template_Basic_Component.php

9
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 %>' );

Loading…
Cancel
Save