File tree Expand file tree Collapse file tree 1 file changed +14
-6
lines changed
Expand file tree Collapse file tree 1 file changed +14
-6
lines changed Original file line number Diff line number Diff line change @@ -23,12 +23,8 @@ class WP_Maintenance_Mode_Admin {
2323 * 3, 2, 1... Start!
2424 */
2525 private function __construct () {
26- $ plugin = WP_Maintenance_Mode::get_instance ();
27- $ this ->plugin_slug = $ plugin ->get_plugin_slug ();
28- $ this ->plugin_settings = $ plugin ->get_plugin_settings ();
29- $ this ->plugin_network_settings = $ plugin ->get_plugin_network_settings ();
30- $ this ->plugin_default_settings = $ plugin ->default_settings ();
31- $ this ->plugin_basename = plugin_basename ( WPMM_PATH . $ this ->plugin_slug . '.php ' );
26+ // Init.
27+ add_action ( 'init ' , array ( $ this , 'load_default_settings ' ) );
3228
3329 // Load admin style sheet and JavaScript.
3430 add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'enqueue_admin_styles ' ) );
@@ -95,6 +91,18 @@ public static function get_instance() {
9591 return self ::$ instance ;
9692 }
9793
94+ /**
95+ * Load default settings.
96+ */
97+ public function load_default_settings () {
98+ $ plugin = WP_Maintenance_Mode::get_instance ();
99+ $ this ->plugin_slug = $ plugin ->get_plugin_slug ();
100+ $ this ->plugin_settings = $ plugin ->get_plugin_settings ();
101+ $ this ->plugin_network_settings = $ plugin ->get_plugin_network_settings ();
102+ $ this ->plugin_basename = plugin_basename ( WPMM_PATH . $ this ->plugin_slug . '.php ' );
103+ $ this ->plugin_default_settings = $ plugin ->default_settings ();
104+ }
105+
98106 /**
99107 * Load CSS files
100108 *
You can’t perform that action at this time.
0 commit comments