Opened 9 years ago
Closed 9 years ago
#35542 closed defect (bug) (fixed)
Media control don't allow button labels to be customized from the args array.
Reported by: | chetanchauhan | Owned by: | westonruter |
---|---|---|---|
Milestone: | 4.5 | Priority: | normal |
Severity: | normal | Version: | 4.2 |
Component: | Customize | Keywords: | has-patch |
Focuses: | Cc: |
Description
The code below doesn't work.
<?php $wp_customize->add_control( new WP_Customize_Media_Control( $wp_customize, 'media_test', array( 'label' => __( 'Example Media (audio) Control' ), 'section' => 'title_tagline', 'mime_type' => 'audio', 'button_labels' => array( 'select' => __( 'Select Audio' ), 'change' => __( 'Change Audio' ), 'default' => __( 'Default' ), 'remove' => __( 'Remove' ), 'placeholder' => __( 'No file selected' ), 'frame_title' => __( 'Select Audio' ), 'frame_button' => __( 'Choose Audio' ), ), ) ) );
Attachments (2)
Change History (9)
This ticket was mentioned in Slack in #core-customize by chetanchauhan. View the logs.
9 years ago
#4
@
9 years ago
- Owner set to celloexpressions
- Status changed from new to reviewing
This has also been brought up by @celloexpressions at https://core.trac.wordpress.org/ticket/33755?replyto=102#comment:102
The button_labels parameter is supposed to be customizable, but I messed that up when I wrote the original
WP_Customize_Media_Control
and the new image control patches and I guess we never caught it. I added those to the control registration, so that element of the custom control is preserved (may not fully be working yet though - could use another set of eyes). This change is backwards compatible for subclasses that previously set button labels by overriding the whole array in a custom class constructor - that still works.
#5
@
9 years ago
Good find @chetanchauhan, I'm surprised no one noticed this sooner.
35542.2.diff merges in my version from #33755 and the change suggested by ocean90 with the initial patch. This should be ready to commit.
Allow media control button labels to be customized for each control seperately