@@ -142,7 +142,7 @@ function ml_default_editor($r)
142142 if (function_exists ('get_current_screen ' )) {
143143 global $ my_admin_page ;
144144 $ screen = get_current_screen ();
145- if ($ screen ->id == $ my_admin_page ) {
145+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
146146 return "tinymce " ;
147147 }
148148 }
@@ -154,7 +154,7 @@ function force_mce_refresh($ver)
154154 if (function_exists ('get_current_screen ' )) {
155155 global $ my_admin_page ;
156156 $ screen = get_current_screen ();
157- if ($ screen ->id == $ my_admin_page ) {
157+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
158158 return $ ver + 99 ;
159159 }
160160 }
@@ -167,7 +167,7 @@ function my_register_mce_button($buttons)
167167 if (function_exists ('get_current_screen ' )) {
168168 global $ my_admin_page ;
169169 $ screen = get_current_screen ();
170- if ($ screen ->id == $ my_admin_page ) {
170+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
171171 array_push ($ buttons , 'front_page_button ' , 'custom_template_button_1 ' , 'custom_template_button_2 ' );
172172 }
173173 }
@@ -182,7 +182,7 @@ function my_custom_plugins()
182182 return $ plugins_array ;
183183 }
184184 $ screen = get_current_screen ();
185- if ($ screen ->id == $ my_admin_page ) {
185+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
186186 $ plugins = array ('table ' , 'code ' , 'contextmenu ' ); //Add any more plugins you want to load here
187187 //Build the response - the key is the plugin name, value is the URL to the plugin JS
188188 foreach ($ plugins as $ plugin ) {
@@ -204,7 +204,7 @@ function tiny_tweaks($initArray)
204204 if (function_exists ('get_current_screen ' )) {
205205 global $ my_admin_page ;
206206 $ screen = get_current_screen ();
207- if ($ screen ->id == $ my_admin_page ) {
207+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
208208 $ initArray ['fontsize_formats ' ] = "5pt 6pt 7pt 8pt 9pt 10pt 11pt 12pt 13pt 14pt 15pt 16pt 17pt 18pt 19pt 20pt 22pt 24pt 26pt 28pt 30pt 32pt 34pt 36pt 38pt " ;
209209 $ initArray ['theme_advanced_blockformats ' ] = 'h2,h3,h4,p ' ;
210210 $ initArray ['wordpress_adv_hidden ' ] = false ;
@@ -223,7 +223,7 @@ function is_root_server_missing()
223223 }
224224 global $ my_admin_page ;
225225 $ screen = get_current_screen ();
226- if ($ screen ->id == $ my_admin_page ) {
226+ if ($ screen != null && $ screen ->id == $ my_admin_page ) {
227227 $ root_server = $ this ->bread ->getOption ('root_server ' );
228228 if ($ root_server == '' ) {
229229 echo '<div id="message" class="error"><p>Missing BMLT Server in settings for bread.</p> ' ;
0 commit comments