Skip to content

Commit

Permalink
moved all files connections to the init hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Fellan-91 committed Nov 22, 2024
1 parent f8562ec commit 52c9482
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lazy-blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,19 @@ public function deactivation_hook() {}
* Init.
*/
public function init() {
add_action( 'init', array( $this, 'init_hook' ), 5 );
}

/**
* Init hook should be used to register user blocks and add customizations.
*/
public function init_hook() {
$this->plugin_path = plugin_dir_path( __FILE__ );
$this->plugin_url = plugin_dir_url( __FILE__ );
$this->plugin_basename = plugin_basename( __FILE__ );

$this->load_text_domain();

$this->include_dependencies();

$this->icons = new LazyBlocks_Icons();
Expand All @@ -143,15 +152,6 @@ public function init() {
$this->templates = new LazyBlocks_Templates();
$this->tools = new LazyBlocks_Tools();

add_action( 'init', array( $this, 'init_hook' ), 5 );

add_action( 'plugins_loaded', array( $this, 'load_text_domain' ) );
}

/**
* Init hook should be used to register user blocks and add customizations.
*/
public function init_hook() {
do_action( 'lzb/init' );
}

Expand Down

0 comments on commit 52c9482

Please sign in to comment.