We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 725ef5b commit ae0f8d9Copy full SHA for ae0f8d9
php/admin-menus/class-edit-menu.php
@@ -142,6 +142,10 @@ private function unshare_network_snippet( $snippet_id ) {
142
private function code_error_callback( $out ) {
143
$error = error_get_last();
144
145
+ if ( is_null( $error ) || ! in_array( $error['type'], array( E_ERROR, E_COMPILE_ERROR, E_USER_ERROR ) ) ) {
146
+ return $out;
147
+ }
148
+
149
$m = '<h2>' . __( "Don't Panic", 'code-snippets' ) . '</h2>';
150
$m .= '<p>' . sprintf( __( 'The code snippet you are trying to save produced a fatal error on line %d:', 'code_snippets' ), $error['line'] ) . '</p>';
151
$m .= '<strong>' . $error['message'] . '</strong>';
0 commit comments