/
home
/
techb158
/
public_html
/
wp-content
/
themes
/
engitech
/
inc
/
backend
/
js
/
/home/techb158/public_html/wp-content/themes/engitech/inc/backend/js
mkdir
upload
Name
Size
Mode
Actions
admin-script.js
1119
0666
edit
dl
rm
simple-likes-public.js
1354
0666
edit
dl
rm
upload_media_widget.js
973
0666
edit
dl
rm
Edit:
/home/techb158/public_html/wp-content/themes/engitech/inc/backend/js/upload_media_widget.js
(973B)
(function( $ ) { 'use strict'; $(document).on("click", ".upload_image_button", function (e) { e.preventDefault(); var $button = $(this); // Create the media frame. var file_frame = wp.media.frames.file_frame = wp.media({ title: 'Select or upload image', library: { // remove these to show all type: 'image' // specific mime }, button: { text: 'Select' }, multiple: false // Set to true to allow multiple files to be selected }); // When an image is selected, run a callback. file_frame.on('select', function () { // We set multiple to false so only get one image from the uploader var attachment = file_frame.state().get('selection').first().toJSON(); $button.siblings('input').val(attachment.url); }); // Finally, open the modal file_frame.open(); }); })(jQuery);
Save
cmd:
run