Fix image fields to open the real media library picker (v2.1.1)

wp_enqueue_media() was never called on the Settings page, so wp.media
was undefined client-side and every image field (Logo, Dark mode logo,
Login logo, Admin favicon) silently fell back to a plain URL prompt
instead of the WordPress media library. Also relabeled the picker
button ("Choose from media library" instead of "{label} url") so it
reads as a picker, not a URL field.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
nixpanel
2026-07-04 03:45:28 -05:00
co-authored by Claude Sonnet 5
parent 55d1788471
commit deab644e38
5 changed files with 18 additions and 4 deletions
+6
View File
@@ -39,6 +39,12 @@ class SettingsPage
return;
}
// Without this, window.wp.media is undefined client-side and every
// image field (Logo, Dark mode logo, Login logo, Admin favicon)
// silently falls back to a plain URL prompt instead of the real media
// library picker (see SettingsField.vue's pickImage()).
wp_enqueue_media();
Assets::enqueue("aurora-admin-settings", "entries/settings.js");
}