Opened 7 months ago
Closed 7 months ago
#22730 closed defect (bug) (fixed)
Move utils.js to wp-includes and make it available for frontend media
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | 3.5 |
| Component: | Media | Version: | 3.5 |
| Severity: | normal | Keywords: | |
| Cc: |
Description
We have user settings for a lot of media items, to remember what the user last did. On a site running something like P2, this is important as the user never really hits the admin. The settings are reset to Medium and Attachment Page every time, and the new setting for whether the user was on Upload or Media Library next is totally thrown off.
In 3.4, we loaded media-upload.php, which allowed utils.js to load and thus we had setUserSetting.
In 3.5, we don't. We should move utils.js to wp-includes/js/wp-cookies.js (or just utils.js) and make it a dependency of media.
It won't save to the DB until an admin hit, but it'll still set and use the cookie.
With this, also move wp-admin/js/utils.js to wp-includes/js/utils.js