Opened 6 years ago
Last modified 3 years ago
#44641 assigned defect (bug)
Customizing Button Text in Custom Media Manager Frame Doesn't Work Anymore
Reported by: | Kelderic | Owned by: | antpb |
---|---|---|---|
Milestone: | Future Release | Priority: | normal |
Severity: | normal | Version: | 4.9.7 |
Component: | Media | Keywords: | has-patch needs-testing 2nd-opinion |
Focuses: | Cc: |
Description
Summary
I have a plugin that calls up the Media Manager. I use the "gallery" state, and customize the main button text via the wp.media
arguments. I've noticed a regression. The text in the primary button is no longer overridden by the arguments that I pass.
What I'm Doing (Code is simplified)
var file_frame = wp.media.frame = wp.media({ frame: 'post', state: 'gallery', library : { type : 'image'}, button: {text: 'Edit Image Order'}, // <----- LINE IN QUESTION multiple: true }); file_frame.open();
What Should Happen
The text inside the primary button in the media manager modal should change from "Create a new Gallery" to "Edit Image Order".
What Actually Happens
The button ignores my arguments and retains its default text.
Attachments (2)
Change History (18)
#2
@
6 years ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 5.3
Hi @Kelderic,
Thanks for the report and for following up with your workaround. I agree that this is hacky and should be fixed. I was able to confirm that this is still an issue in WordPress 5.2-beta3, though I wasn't able to investigate why this is happening. I'm going to add this to the 5.3 milestone for further investigation.
#3
@
5 years ago
I appreciate the response, @joemcgill, but I'm afraid that this has gotten lost in the hundreds of tickets assigned to 5.3.
#4
@
5 years ago
- Keywords has-patch needs-testing added; needs-patch removed
I've attached a patch, 44641.diff, but i'm not sure if this is what we want. On one hand, it does change the button label in the initial frame displayed. However, when you try to go to different frames by clicking the menu nav links in the left panel. The button labels of the new loaded frames will then revert to using the default label.
Now my question is, do we want the button label we set in the initialization of wp.media()
-
var file_frame = wp.media.frame = wp.media({ frame: 'post', state: 'gallery', library : { type : 'image'}, button: {text: 'Edit Image Order'}, // <----- LINE IN QUESTION multiple: true });
used in all of the frames? Or we just want it to be in the initial opened frame?
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
#7
@
5 years ago
- Keywords early added
- Milestone changed from 5.3 to 5.4
This ticket was discussed during today's bug scrub. It's a little late in the 5.3 cycle for inclusion, so it's being moved to 5.4 with an early
tag for more soak time.
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
5 years ago
#11
@
5 years ago
Thanks so much for the patch @donmhico ! I’ve assigned this ticket to myself to track it and test your patch. Will update soon with any findings. :)
#12
@
5 years ago
Sure thing @antpb. Thanks for owning the ticket. If there's anything else I can do to bring this ticket to resolution, let me know :)
This ticket was mentioned in Slack in #core by david.baumwald. View the logs.
5 years ago
This ticket was mentioned in Slack in #core-media by antpb. View the logs.
5 years ago
#15
@
5 years ago
- Milestone changed from 5.4 to Future Release
Hi,
With 5.4 Beta 3 approaching and the Beta period reserved for bugs introduced during the cycle, this is being moved to Future Release. If any maintainer or committer feels this should be included or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.
I've found a workaround, btw. Before triggering the frame.open() function, I can set my own value into
wp.media.view.l10n.insertIntoPost
. Then reset that value after I open the frame.This works and doesn't affect any other frames, but it seems hacky.