HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux WebLive 5.15.0-79-generic #86-Ubuntu SMP Mon Jul 10 16:07:21 UTC 2023 x86_64
User: ubuntu (1000)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/html/wpkoopkj/wp-content/themes/ohio/inc/menu/js/image-upload.js
jQuery(function($) {
    'use strict';

    var custom_uploader;

    $( '#update-nav-menu' ).on( 'click', '.upload_image_button', function() {
        if ( custom_uploader ) {
            custom_uploader.open();
            return false;
        }

        custom_uploader = wp.media.frames.file_frame = wp.media( {
            title: 'Choose Image',
            button: { text: 'Choose Image' },
            multiple: false
        } );

        custom_uploader.on( 'select', () => {
            var attachment = custom_uploader.state().get( 'selection' ).first().toJSON();
            $(this).siblings( '.upload_image' ).val( attachment.url ).trigger( 'change' );
            $(this).siblings( '.image_uploaded' ).attr( 'src', attachment.url ).show();

            custom_uploader.close();
        } );

        custom_uploader.open();

        return false;
    } );

    $( '#update-nav-menu' ).on( 'click', '.remove_image_button', function() {
        $(this).siblings( '.upload_image' ).val( '' ).trigger( 'change' );
        $(this).siblings( '.image_uploaded' ).attr( 'src', '' ).hide();

        return false;
    } );

    $( '#menu-to-edit' ).on( 'sortstop', function() {
        $(this).find( '.menu-item' ).each( function() {
            var $image_select = $(this).find('.field-ohio_mega_menu_image');
            var $image_position = $(this).find('.field-ohio_mega_menu_bg_position');
            var $image_repeat = $(this).find('.field-ohio_mega_menu_bg_repeat');

            setTimeout( () => {
                if ( $(this).is( '.menu-item-depth-1' ) ) {
                    $image_select.show();
                    $image_position.show();
                    $image_repeat.show();
                } else {
                    $image_select.hide();
                    $image_position.hide();
                    $image_repeat.hide();
                }
            }, 100 );
        } );
    } );
});