fix(ns): root-qualify WP_* classes after PSR-4 move

Bare WP_REST_Server etc. resolve under AKSRT\* namespaces; prefix with
\ for Balance REST and other type hints / constructors.
This commit is contained in:
kate522 committed 2026-07-17 15:12:14 +08:00
1 parent d3107a449b
commit 1e21911b03
9 files changed
+27 -27

No files matched your search

+1 -1
View File
@@ -261,7 +261,7 @@ class Moderation {
*/
public function after_post(int $comment_id, $comment_approved, array $commentdata = []): void {
$comment = get_comment($comment_id);
if (!$comment instanceof WP_Comment) {
if (!$comment instanceof \WP_Comment) {
return;
}
+1 -1
View File
@@ -130,7 +130,7 @@ trait ModerationPart1 {
}
}
private function resolve_result_from_runtime_or_default(array $commentdata, WP_Comment $comment): array {
private function resolve_result_from_runtime_or_default(array $commentdata, \WP_Comment $comment): array {
$fp_data = $this->comment_fingerprint($commentdata);
if ($fp_data !== '' && isset($this->moderation_result_map[$fp_data])) {
return $this->moderation_result_map[$fp_data];