Created
October 20, 2014 17:13
-
-
Save robskidmore/88df3080e5100c65a8d2 to your computer and use it in GitHub Desktop.
Using the Media uploader in wordpress make sure to include wp_enqueue_media();
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var frame; | |
$(function(){ | |
$('#cloner-csv-button').click(function () { | |
// var $el =$(this); | |
if(frame) { | |
frame.open(); | |
return; | |
} | |
frame = wp.media.frames.nsClonerCSV = wp.media({ | |
title: 'Choose Search and Replace CSV', | |
library: { | |
type: 'text/csv' | |
}, | |
button: { | |
text: 'Select CSV' | |
} | |
}); | |
frame.open(); | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment