Customize uploader title and btn text

This commit is contained in:
Jay Wood
2016-09-30 12:07:19 -04:00
parent 53e6e82218
commit f6a8e942d7
2 changed files with 11 additions and 5 deletions

View File

@ -403,10 +403,14 @@ class CWV2_Admin {
'type' => 'editor',
),
array(
'id' => 'bg_image',
'name' => __( 'Background Image', 'content-warning-v2' ),
'desc' => __( 'If not empty, the dialog will use this instead of the background opacity and color.', 'content-warning-v2' ),
'type' => 'media',
'id' => 'bg_image',
'name' => __( 'Background Image', 'content-warning-v2' ),
'desc' => __( 'If not empty, the dialog will use this instead of the background opacity and color.', 'content-warning-v2' ),
'type' => 'media',
'options' => array(
'uploader-title' => __( 'Content Warning Background Image', 'content-warning-v2' ),
'uploader-btn' => __( 'Select Background Image', 'content-warning-v2' ),
),
),
array(
'id' => 'bg_opacity',

View File

@ -153,10 +153,12 @@ class CWV2_Settings {
}
$label = isset( $options['label'] ) ? $options['label'] : __( 'Upload', 'content-warning-v2' );
$uploader_title = isset( $options['uploader-title'] ) ? sprintf( 'data-uploader-title="%s"', $options['uploader-title'] ) : '';
$uploader_button = isset( $options['uploader-btn'] ) ? sprintf( 'data-uploader-btn-txt="%s"', $options['uploader-btn'] ) : '';
?><fieldset>
<input type="text" name="<?php echo $field_id; ?>" id="<?php echo $field_id; ?>" value="<?php echo $option_value; ?>" class="regular-text" />
<input type="button" class="button button-secondary upload_image_button" value="<?php echo $label; ?>" data-target-id="<?php echo $field_id; ?>" />
<input type="button" class="button button-secondary upload_image_button" value="<?php echo $label; ?>" data-target-id="<?php echo $field_id; ?>" <?php echo $uploader_button; ?> <?php echo $uploader_title; ?> />
</fieldset><?php
if ( ! empty( $description ) ) {