Add upstream

This commit is contained in:
root
2019-10-24 00:12:05 +02:00
parent 85d41e4216
commit ac980f592c
3504 changed files with 1049983 additions and 29971 deletions

View File

@@ -0,0 +1,20 @@
// shariff media upload
jQuery(document).ready(function($){
$("#shariff-upload-btn").click(function(e) {
e.preventDefault();
var image = wp.media({
title: shariff_media.choose_image,
multiple: false
}).open()
.on("select", function(){
// this will return the selected image from the media uploader, the result is an object
var uploaded_image = image.state().get("selection").first();
// output to the console uploaded_image
console.log(uploaded_image);
// convert uploaded_image to a JSON object to make accessing it easier
var image_url = uploaded_image.toJSON().url;
// assign the url value to the input field
$("#shariff-image-url").val(image_url);
});
});
});