diff --git a/lib/abstracts/Event_Type.php b/lib/abstracts/Event_Type.php index ae92035..c9a70d0 100644 --- a/lib/abstracts/Event_Type.php +++ b/lib/abstracts/Event_Type.php @@ -331,7 +331,7 @@ public function __get( $key ) { if ( isset( $this->$key ) ) { return $this->$key; } else { - return new WP_error( 'logger_param_not_set', 'The logger param ' . $key . ' could not be found.' ); + return new WP_Error( 'logger_param_not_set', 'The logger param ' . $key . ' could not be found.' ); } } diff --git a/lib/abstracts/Writer.php b/lib/abstracts/Writer.php index 09f432d..6b0bc0f 100644 --- a/lib/abstracts/Writer.php +++ b/lib/abstracts/Writer.php @@ -90,7 +90,7 @@ public function __get( $key ) { if ( isset( $this->$key ) ) { return $this->$key; } else { - return new WP_error( 'batch_task_param_not_set', 'The batch task key ' . $key . ' could not be found.' ); + return new WP_Error( 'batch_task_param_not_set', 'The batch task key ' . $key . ' could not be found.' ); } } } \ No newline at end of file diff --git a/lib/abstracts/registries/Event_Registry.php b/lib/abstracts/registries/Event_Registry.php index 2edb23f..6c25f15 100644 --- a/lib/abstracts/registries/Event_Registry.php +++ b/lib/abstracts/registries/Event_Registry.php @@ -232,17 +232,17 @@ public function get( $key ) { // If the logged event could not be found, search event type keys. if ( is_wp_error( $result ) ) { - $event_types = $this->filter( [ + $event_type = $this->find( [ 'type' => $key, ] ); // If that also comes up empty, return the error. - if ( empty( $event_types ) ) { + if ( is_wp_error( $event_type ) ) { return $result; } // Return the discovered event. - $result = $event_types[0]; + $result = $event_type; } return $result;