File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -158,6 +158,18 @@ class Media extends Settings_Component implements Setup {
158158 public function __construct ( Plugin $ plugin ) {
159159 $ this ->plugin = $ plugin ;
160160
161+ add_action ( 'init ' , array ( $ this , 'init_hook ' ) );
162+
163+ // Add upgrade hook, since setup methods are called after the connect upgrade has run.
164+ add_action ( 'cloudinary_version_upgrade ' , array ( $ this , 'upgrade_media_settings ' ) );
165+ }
166+
167+ /**
168+ * Initialize WordPress hooks for the Cloudinary media integration.
169+ *
170+ * @return void
171+ */
172+ public function init_hook () {
161173 /**
162174 * Filter the Cloudinary Media Library filters.
163175 *
@@ -173,9 +185,6 @@ public function __construct( Plugin $plugin ) {
173185 SYNC ::META_KEYS ['unsynced ' ] => __ ( 'Unsynced ' , 'cloudinary ' ),
174186 )
175187 );
176-
177- // Add upgrade hook, since setup methods are called after the connect upgrade has run.
178- add_action ( 'cloudinary_version_upgrade ' , array ( $ this , 'upgrade_media_settings ' ) );
179188 }
180189
181190 /**
Original file line number Diff line number Diff line change @@ -35,10 +35,21 @@ class Meta_Box {
3535 */
3636 public function __construct ( Plugin $ plugin ) {
3737 $ this ->plugin = $ plugin ;
38- add_action ( 'add_meta_boxes ' , array ( $ this , 'register_meta_box ' ) );
38+
39+ add_action ( 'init ' , array ( $ this , 'init_hook ' ) );
40+
3941 $ this ->register_handlers ();
4042 }
4143
44+ /**
45+ * Initialize hooks for the meta box.
46+ *
47+ * @return void
48+ */
49+ public function init_hook () {
50+ add_action ( 'add_meta_boxes ' , array ( $ this , 'register_meta_box ' ) );
51+ }
52+
4253 /**
4354 * Register meta box for image sizes.
4455 */
You can’t perform that action at this time.
0 commit comments