Opened 11 years ago
Closed 11 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 |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.5 |
| Component: | Customize | Version: | 4.2 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: |
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.
11 years ago
#4
@
11 years ago
- Owner set to
- Status new → 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_Controland 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.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Allow media control button labels to be customized for each control seperately