How to get attachment id as soon as it is uploaded through media uploader in jquery?

You are close, you just need to hook into the add event instead of the reset event. (In case you did not know, these are standard events provided by Backbone collections. So familiarizing yourself with that will be helpful when developing things around stuff where WordPress employs Backbone.js.) So basically you’d modify your code like … Read more

What is the simplest ajax upload plugin or script to be used with wordpress?

I have used the native uploader with great results. Try adding this snippet of JS: jQuery(‘#upload_image_button’).click(function() { formfield = jQuery(‘#fwpPhoto’).attr(‘name’); tb_show(”, ‘media-upload.php?type=image&amp;TB_iframe=true’); return false; }); window.send_to_editor = function(html) { imgurl = jQuery(‘img’,html).attr(‘src’); jQuery(‘#fwpPhoto’).val(imgurl); tb_remove(); } Then, in your HTML: <input id=”fwpPhoto” name=”facultyPhoto” value=””> <input id=”upload_image_button” type=”button” value=”Upload Image”> For Multiple Uploaders <input id=”facultyPhoto-1″ name=”facultyPhoto-1″ value=”” … Read more

How to modify wp.media to get and display multiple images

So, this works. I’d be happy to implement and credit improvements! /** * @Script: WordPress Multiple Image Selection in jQuery * @Version: 0.1 * @Author: CK MacLeod * @Author URI: http://ckmacleod.com * @License: GPL3 */ jQuery(document).ready( function( $ ) { var myplugin_media_upload; $(‘#myplugin-change-image’).click(function(e) { e.preventDefault(); // If the uploader object has already been created, reopen … Read more

Make jQuery library load before plugin files

If you look at the wp_enqueue_script Codex Documentation, you’ll see one of the options is $deps, this would mean that your script is dependent upon another script, simply add jquery as a dependancy and your scripts will load in the correct place. If you set a handle for the other scripts you can use them … Read more

How to add a ” waiting” icon for an ajax in WP frontend?

You can use the inbuilt spinner class : Add the class to the HTML where you want the spinner to appear, for example after your search button : <button type=”button” id=”searchsubmit”>Search Button</button> <span class=”spinner”></span> <!– Add this spinner class where you want it to appear–> In jQuery you should add the is-active class to the … Read more

WordPress AJAX File Upload – FrontEnd

Hi You have Use this COde For WordPress front-end AJAX file upload tutorial Code Here is my code: In my template file example.php <form enctype=”multipart/form-data”> <input type=”text” name=”support_title” class=”support-title”> <input type=”file” id=”sortpicture” name=”upload”> <input class=”save-support” name=”save_support” type=”button” value=”Save”> </form> This is in ajax-file-upload.js jQuery(document).on(‘click’, ‘.save-support’, function (e) { var supporttitle = jQuery(‘.support-title’).val(); var querytype = … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)