Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Global Media tab doesn't show outside posts #142

Open
1 task done
uprise10 opened this issue Dec 16, 2022 · 0 comments
Open
1 task done

[Bug]: Global Media tab doesn't show outside posts #142

uprise10 opened this issue Dec 16, 2022 · 0 comments

Comments

@uprise10
Copy link

uprise10 commented Dec 16, 2022

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

  1. Use, for example, and ACF options page, or any other page outside an edit-post page
  2. Add a media field and click the "Add Media" button
  3. 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

  • Version 0.2.0

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

  • I agree to follow this project's Code of Conduct
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant