Skip to content

Commit ad1d045

Browse files
committed
Add line number to fatal error message
1 parent 24b6377 commit ad1d045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

php/admin-menus/class-edit-menu.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ private function code_error_callback( $out ) {
143143
$error = error_get_last();
144144

145145
$m = '<h2>' . __( "Don't Panic", 'code-snippets' ) . '</h2>';
146-
$m .= '<p>' . __( 'The code snippet you are trying to save produced a fatal error:', 'code_snippets' ) . '</p>';
146+
$m .= '<p>' . sprintf( __( 'The code snippet you are trying to save produced a fatal error on line %d:', 'code_snippets' ), $error['line'] ) . '</p>';
147147
$m .= '<strong>' . $error['message'] . '</strong>';
148148
$m .= '<p>' . __( 'The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.' ) . '</p>';
149149
$m .= '<p>' . __( 'Please use the back button in your browser to return to the previous page and try to fix the code error.', 'code-snippets' );

0 commit comments

Comments
 (0)