Файловый менеджер - Редактировать - /home/beautybuzzbeyond/public_html/wp-content/themes/music-night/js/ajax-upload.js
Назад
jQuery(document).ready(function($){ // Uploading files var file_frame; jQuery('.cupp_wpmu_button').on('click', function( event ){ event.preventDefault(); // If the media frame already exists, reopen it. if ( file_frame ) { file_frame.open(); return; } // Create the media frame. file_frame = wp.media.frames.file_frame = wp.media({ title: jQuery( this ).data( 'uploader_title' ), button: { text: jQuery( this ).data( 'uploader_button_text' ), }, multiple: false // Set to true to allow multiple files to be selected }); // When an image is selected, run a callback. file_frame.on( 'select', function() { // We set multiple to false so only get one image from the uploader attachment = file_frame.state().get('selection').first().toJSON(); // Do something with attachment.id and/or attachment.url here // write the selected image url to the value of the #cupp_meta text field jQuery('#cupp_meta').val(''); jQuery('#cupp_upload_meta').val(attachment.url); jQuery('#cupp_upload_edit_meta').val('/wp-admin/post.php?post='+attachment.id+'&action=edit&image-editor'); jQuery('.cupp-current-img').attr('src', attachment.url).removeClass('placeholder'); }); // Finally, open the modal file_frame.open(); }); // Update hidden field meta when external option url is entered jQuery('#cupp_meta').blur(function(event) { if( '' !== $(this).val() ) { jQuery('#cupp_upload_meta').val(''); jQuery('.cupp-current-img').attr('src', $(this).val()).removeClass('placeholder'); } }); // Remove Image Function jQuery('.edit_options').hover(function(){ jQuery(this).stop(true, true).animate({opacity: 1}, 100); }, function(){ jQuery(this).stop(true, true).animate({opacity: 0}, 100); }); jQuery('.remove_img').on('click', function( event ){ var placeholder = jQuery('#cupp_placeholder_meta').val(); jQuery(this).parent().fadeIn('fast', function(){ // jQuery(this).remove(); jQuery('.cupp-current-img').addClass('placeholder').attr('src', placeholder); }); jQuery('#cupp_upload_meta, #cupp_upload_edit_meta, #cupp_meta').val(''); }); });
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка