Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions fields/class-cmb-file-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public function default_args() {
'text',
'application',
),
'string-select-file' => esc_html__( 'Select File', 'cmb' ),
)
);
}
Expand All @@ -48,6 +49,12 @@ function enqueue_scripts() {
wp_enqueue_media( array( 'post' => $post_ID ) );
wp_enqueue_script( 'cmb-file-upload', trailingslashit( CMB_URL ) . 'js/file-upload.js', array( 'jquery', 'cmb-scripts' ), CMB_VERSION );

wp_localize_script( 'cmb-file-upload', 'CMBFile', array(
'strings' => array(
'selectFile' => $this->args['string-select-file'],
),
) );

}

/**
Expand Down
1 change: 1 addition & 0 deletions fields/class-cmb-image-field.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public function default_args() {
'image',
),
'show_size' => false,
'string-select-file' => esc_html__( 'Select Image', 'cmb' ),
)
);
}
Expand Down
2 changes: 1 addition & 1 deletion js/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jQuery( document ).ready( function() {

var frameArgs = {
multiple: false,
title: 'Select File',
title: CMBFile.strings.selectFile
};

library = container.attr( 'data-type' ).split( ',' );
Expand Down