diff --git a/.editorconfig b/.editorconfig index 0c4982b..624da1a 100644 --- a/.editorconfig +++ b/.editorconfig @@ -18,6 +18,10 @@ indent_size = 2 indent_style = tab indent_size = 4 +[*.php] +indent_style = tab +indent_size = 4 + [*.md] trim_trailing_whitespace = false diff --git a/platforms/wordpress/templates/Template_Component.php b/platforms/wordpress/templates/Template_Component.php index 087b1f7..ef39d78 100644 --- a/platforms/wordpress/templates/Template_Component.php +++ b/platforms/wordpress/templates/Template_Component.php @@ -5,13 +5,13 @@ namespace AXEWEB_Blocks\Blocks\<%= ownerClass %>\<%= blockClassModel %>; class <%= blockClassModel %>_Component extends \Core\Component { public function get_content( $args = [] ): string { - $default_args = apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::default_args', [] ); // Not really practical. + $default_args = apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::default_args', [] ); // Not really practical. - $args = apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::prepare_args', array_merge( $default_args, $args ) ); + $args = apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::prepare_args', array_merge( $default_args, $args ) ); - $output = ( include( __DIR__ . '/templates/<%= blockFilename %>.template.php' ) )( $args, self::class ); + $output = ( include( __DIR__ . '/templates/<%= blockFilename %>.template.php' ) )( $args, self::class ); - return apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::content', $output ); + return apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::content', $output ); } <% if (!include_acf_block && !include_native_gutenberg_block) { %>function register_assets(): void { @@ -24,7 +24,6 @@ class <%= blockClassModel %>_Component extends \Core\Component { wp_enqueue_script( 'script-block-<%= blockFilename %>' ); }<% } %> - <% if (include_elementor_widget) { %>function register_custom_logic(): void { add_action( 'elementor/widgets/widgets_registered', [ $this, 'register_elementor_widget' ] ); } @@ -34,8 +33,8 @@ class <%= blockClassModel %>_Component extends \Core\Component { } <% } %><% if (include_acf_block) { %> function register_acf_block() { - $this->register_block( __DIR__ . "/<%= blockFilename %>.block.json", [ - 'style_assets' => [ + $this->register_block( __DIR__ . "/<%= blockFilename %>.block.json", [ + 'style_assets' => [ [ 'name' => '<%= blockFilename %>', 'url' => plugins_url( 'templates/styles/<%= blockFilename %>.min.css', __FILE__ ), @@ -47,9 +46,8 @@ class <%= blockClassModel %>_Component extends \Core\Component { 'url' => plugins_url( 'templates/scripts/<%= blockFilename %>.min.js', __FILE__ ), ] ] - ] ); - } - + ] ); + } <% } %><% if (include_native_gutenberg_block) { %> function register_native_gutenberg_block() { register_block_type( __DIR__ . '/templates/gutenberg-block/block.json' );<% if (include_script) { %>