PluginProbe
WP Ultimate Post Grid / 1.9
WP Ultimate Post Grid v1.9
4.1.1 trunk 1.5 1.6 1.7 1.7.1 1.7.2 1.8 1.9 2.0 2.1 2.2 2.3 2.4.0 2.5.0 2.6.0 2.7.0 2.8.0 2.8.2 3.0.0 3.3.0 3.4.0 3.5.0 3.6.0 3.7.0 All 32 releases
wp-ultimate-post-grid / js / admin_post.js

admin_post.js in WP Ultimate Post Grid 1.9, at js/admin_post.js

27 lines 940 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 jQuery('#wpupg_add_custom_image').on('click', function(e) {
2 e.preventDefault();
3
4 var button = jQuery(this);
5 var input_url = button.parents('#wpupg_form_post').find('#wpupg_custom_image');
6 var input_id = button.parents('#wpupg_form_post').find('#wpupg_custom_image_id');
7
8 if(typeof wp.media == 'function') {
9 var custom_uploader = wp.media({
10 title: 'Insert Media',
11 button: {
12 text: 'Set Custom Image'
13 },
14 multiple: false
15 })
16 .on('select', function() {
17 var attachment = custom_uploader.state().get('selection').first().toJSON();
18 input_url.val(attachment.url);
19 input_id.val(attachment.id);
20 })
21 .open();
22 }
23 });
24
25 jQuery('#wpupg_custom_image').on('keyup change', function() {
26 jQuery(this).siblings('#wpupg_custom_image_id').val('');
27 });