Skip to content

Commit bfaef6e

Browse files
committed
Prepare init hooks
1 parent 433e690 commit bfaef6e

2 files changed

Lines changed: 19 additions & 0 deletions

File tree

php/class-media.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,15 @@ class Media extends Settings_Component implements Setup {
157157
*/
158158
public function __construct( Plugin $plugin ) {
159159
$this->plugin = $plugin;
160+
add_action( 'init', array( $this, 'init_hook' ) );
161+
}
160162

163+
/**
164+
* Initialize WordPress hooks for the Cloudinary media integration.
165+
*
166+
* @return void
167+
*/
168+
public function init_hook() {
161169
/**
162170
* Filter the Cloudinary Media Library filters.
163171
*

php/class-meta-box.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,17 @@ class Meta_Box {
3535
*/
3636
public function __construct( Plugin $plugin ) {
3737
$this->plugin = $plugin;
38+
add_action( 'init', array( $this, 'init_hook' ) );
39+
}
40+
41+
/**
42+
* Initializes hooks for the meta box.
43+
*
44+
* Hooks into WordPress to add meta boxes and registers necessary handlers.
45+
*
46+
* @return void
47+
*/
48+
public function init_hook() {
3849
add_action( 'add_meta_boxes', array( $this, 'register_meta_box' ) );
3950
$this->register_handlers();
4051
}

0 commit comments

Comments
 (0)