Browse Source

Add WordPress hook name to components.

wordpress-build
Roman Axelrod 3 years ago
parent
commit
a4193d63e1
  1. 4
      package-lock.json
  2. 2
      package.json
  3. 1
      platforms/wordpress/templates/Template_Basic_Component.php
  4. 1
      platforms/wordpress/templates/Template_Component.php

4
package-lock.json

@ -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",

2
package.json

@ -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",

1
platforms/wordpress/templates/Template_Basic_Component.php

@ -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();

1
platforms/wordpress/templates/Template_Component.php

@ -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.

Loading…
Cancel
Save