Add WordPress hook name to components.
This commit is contained in:
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@axe-web/block-dev-tool",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.27",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@axe-web/block-dev-tool",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.27",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@braintree/sanitize-url": "^6.0.0",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@axe-web/block-dev-tool",
|
||||
"version": "1.0.26",
|
||||
"version": "1.0.27",
|
||||
"author": {
|
||||
"name": "AXE-WEB",
|
||||
"email": "office@axe-web.com",
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace AXEWEB_Blocks\Blocks\<%= ownerClass %>\<%= blockClassModel %>;
|
||||
|
||||
class <%= blockClassModel %>_Component <% if (isComponentManager || isElementor) { %>extends \Core\Component <% } %>{
|
||||
const VERSION = '<%= version %>';
|
||||
public $hook_prefix = 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>';
|
||||
|
||||
<% if (!isComponentManager && !isElementor) { %>public function __construct() {
|
||||
parent::__construct();
|
||||
|
||||
@@ -4,6 +4,7 @@ namespace AXEWEB_Blocks\Blocks\<%= ownerClass %>\<%= blockClassModel %>;
|
||||
|
||||
class <%= blockClassModel %>_Component extends \Core\Component {
|
||||
const VERSION = '<%= version %>';
|
||||
public $hook_prefix = 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>';
|
||||
|
||||
public function get_content( $args = [] ): string {
|
||||
$default_args = apply_filters( 'axeweb_blocks/<%= ownerFilename %>/<%= blockFilename %>::default_args', [] ); // Not really practical.
|
||||
|
||||
Reference in New Issue
Block a user