Description of the bug
However this is somehow intended, I somehow see this this as a bug, since the Global Media tab is only showed when editing posts.
When you want to use global media on other places (like custom options pages, or even ACF option pages), the script for the tab is not loading.
That is because of this lines in enqueueScripts():
if ('post' !== get_current_screen()->base) {
return;
}
What is the reason behind it and can this be removed, or at least being overridden through a filter?
When just removing these lines it seems to work great, so I don't understand this choice? But probably there is one, so I'm curious :-)
PS: same goes for the CSS file, of course :-)
Reproduction instructions
- Use, for example, and ACF options page, or any other page outside an edit-post page
- Add a media field and click the "Add Media" button
- No "Global Media" tab will show
Expected behavior
I'd expect that the tab is visible for any "Add Media" button everywhere in the backend.
Environment info
Relevant log output
No response
Additional context
When just removing the get_current_screen() check it works. So adding a filter for that at least would be very great.
Code of Conduct
Description of the bug
However this is somehow intended, I somehow see this this as a bug, since the Global Media tab is only showed when editing posts.
When you want to use global media on other places (like custom options pages, or even ACF option pages), the script for the tab is not loading.
That is because of this lines in
enqueueScripts():What is the reason behind it and can this be removed, or at least being overridden through a filter?
When just removing these lines it seems to work great, so I don't understand this choice? But probably there is one, so I'm curious :-)
PS: same goes for the CSS file, of course :-)
Reproduction instructions
Expected behavior
I'd expect that the tab is visible for any "Add Media" button everywhere in the backend.
Environment info
Relevant log output
No response
Additional context
When just removing the get_current_screen() check it works. So adding a filter for that at least would be very great.
Code of Conduct