From d5be2879d0f4f68a35efe7b40a65b6267910d6ff Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 30 Jul 2026 11:05:25 +0800 Subject: [PATCH] fix(user): accept core avatar hook payload --- inc/helpers/aksrt-avatar.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/helpers/aksrt-avatar.php b/inc/helpers/aksrt-avatar.php index 8fb86f73..fb2377ce 100644 --- a/inc/helpers/aksrt-avatar.php +++ b/inc/helpers/aksrt-avatar.php @@ -182,7 +182,7 @@ if (!function_exists('aksrt_render_admin_avatar_field')) { } } -add_filter('user_profile_update_errors', static function (WP_Error $errors, bool $update, WP_User $user): void { +add_filter('user_profile_update_errors', static function (WP_Error $errors, bool $update): void { if (empty($_FILES['aksrt_avatar_file']['name']) || !aksrt_is_avatar_upload_enabled()) { return; } @@ -207,7 +207,7 @@ add_filter('user_profile_update_errors', static function (WP_Error $errors, bool if (empty($checked['type']) || empty($checked['ext']) || !wp_match_mime_types('image', $checked['type']) || !$image_size || ((int) $image_size[0] * (int) $image_size[1]) > 40000000) { $errors->add('aksrt_avatar_type', __('头像必须是有效的 JPG、PNG、GIF 或 WebP 图片,且总像素不能超过 4000 万。', 'aksrt')); } -}, 10, 3); +}, 10, 2); add_action('personal_options_update', 'aksrt_save_admin_avatar_field'); add_action('edit_user_profile_update', 'aksrt_save_admin_avatar_field');