From f6a8e942d775f22d579d54c607387dcf00f40014 Mon Sep 17 00:00:00 2001 From: Jay Wood Date: Fri, 30 Sep 2016 12:07:19 -0400 Subject: [PATCH] Customize uploader title and btn text --- includes/admin.php | 12 ++++++++---- includes/settings.php | 4 +++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/includes/admin.php b/includes/admin.php index b0a7ad8..8c2ba57 100644 --- a/includes/admin.php +++ b/includes/admin.php @@ -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', diff --git a/includes/settings.php b/includes/settings.php index ecae4d5..f31e1b4 100644 --- a/includes/settings.php +++ b/includes/settings.php @@ -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'] ) : ''; ?>
- + />