diff --git a/includes/Checker/Check_Result.php b/includes/Checker/Check_Result.php index 4750c09f2..520e6d25f 100644 --- a/includes/Checker/Check_Result.php +++ b/includes/Checker/Check_Result.php @@ -100,6 +100,7 @@ public function add_message( $error, $message, $args = array() ) { 'line' => 0, 'column' => 0, 'link' => '', + 'check' => '', ); $data = array_merge( diff --git a/includes/Traits/Amend_Check_Result.php b/includes/Traits/Amend_Check_Result.php index b13bb3c4a..489fff42d 100644 --- a/includes/Traits/Amend_Check_Result.php +++ b/includes/Traits/Amend_Check_Result.php @@ -16,6 +16,7 @@ */ trait Amend_Check_Result { + use Check_Name; use File_Editor_URL; /** @@ -41,6 +42,7 @@ protected function add_result_message_for_file( Check_Result $result, $error, $m 'line' => $line, 'column' => $column, 'link' => $this->get_file_editor_url( $result, $file, $line ), + 'check' => $this->get_name(), ) ); } diff --git a/includes/Traits/Check_Name.php b/includes/Traits/Check_Name.php new file mode 100644 index 000000000..a71b7f3ee --- /dev/null +++ b/includes/Traits/Check_Name.php @@ -0,0 +1,33 @@ +getShortName() ); + $class_name = str_replace( '_check', '', $class_name ); + + return $class_name; + } +}