Skip to content

Commit adac10b

Browse files
fix: early translations loading error
1 parent acd6cf1 commit adac10b

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

inc/Block_Patterns.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ class Block_Patterns {
3737
* Block_Patterns constructor.
3838
*/
3939
public function __construct() {
40-
$this->setup_properties();
4140

4241
add_action( 'init', array( $this, 'run' ) );
4342
}
@@ -48,6 +47,7 @@ public function __construct() {
4847
* @return void
4948
*/
5049
public function run() {
50+
$this->setup_properties();
5151
$this->register_categories();
5252
$this->register_patterns();
5353
}

inc/Block_Styles.php

+20-3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,26 @@ class Block_Styles {
2626
* Block Styles constructor.
2727
*/
2828
public function __construct() {
29+
30+
add_action( 'init', array( $this, 'run' ) );
31+
}
32+
33+
/**
34+
* Run the class functionality.
35+
*
36+
* @return void
37+
*/
38+
public function run() {
39+
$this->setup_properties();
40+
$this->add_block_styles();
41+
}
42+
43+
/**
44+
* Setup class properties.
45+
*
46+
* @return void
47+
*/
48+
private function setup_properties() {
2949
$this->styles = array(
3050
'core/categories' => array(
3151
array(
@@ -34,9 +54,6 @@ public function __construct() {
3454
),
3555
),
3656
);
37-
38-
add_action( 'init', array( $this, 'add_block_styles' ) );
39-
4057
}
4158

4259
/**

0 commit comments

Comments
 (0)