classes/Tools/Crop/CropTool.php
public function enqueueTheGoods($hook)
    {
        add_thickbox();

        if ($hook == 'post.php')
            wp_enqueue_media ();
        else if ($hook == 'upload.php')
        {
            $mode = get_user_option('media_library_mode', get_current_user_id()) ? get_user_option('media_library_mode', get_current_user_id()) : 'grid';
            if (isset($_GET['mode']) && in_array($_GET ['mode'], ['grid','list']))
            {
                $mode = $_GET['mode'];
                update_user_option(get_current_user_id(), 'media_library_mode', $mode);
            }

            if ($mode=='list')
            {
                $version = get_bloginfo('version');
                if (version_compare($version, '4.2.2') < 0)
                    wp_dequeue_script ( 'media' );

                wp_enqueue_media ();
            }
        }
        else
            wp_enqueue_style ( 'media-views' );

        wp_enqueue_style( 'wp-pointer' );
        wp_enqueue_style ( 'ilab-modal-css', ILAB_PUB_CSS_URL . '/ilab-modal.min.css' );
        wp_enqueue_style ( 'ilab-media-tools-css', ILAB_PUB_CSS_URL . '/ilab-media-tools.min.css' );
        wp_enqueue_script( 'wp-pointer' );
        wp_enqueue_script ( 'ilab-modal-js', ILAB_PUB_JS_URL. '/ilab-modal.js', ['jquery'], false, true );
        wp_enqueue_script ( 'ilab-media-tools-js', ILAB_PUB_JS_URL. '/ilab-media-tools.js', ['jquery'], false, true );
    }
public function enqueueTheGoods($hook)
    {
        add_thickbox();

        if ($hook == 'post.php')
            wp_enqueue_media ();
        else if ($hook == 'upload.php')
        {
            $mode = get_user_option('media_library_mode', get_current_user_id()) ? get_user_option('media_library_mode', get_current_user_id()) : 'grid';
            if (isset($_GET['mode']) && in_array($_GET ['mode'], ['grid','list']))
            {
                $mode = $_GET['mode'];
                update_user_option(get_current_user_id(), 'media_library_mode', $mode);
            }

            if ($mode=='list')
            {
                $version = get_bloginfo('version');
                if (version_compare($version, '4.2.2') < 0)
                    wp_dequeue_script ( 'media' );

                wp_enqueue_media ();
            }
        }
        else
            wp_enqueue_style ( 'media-views' );

        wp_enqueue_style( 'wp-pointer' );
        wp_enqueue_style ( 'ilab-modal-css', ILAB_PUB_CSS_URL . '/ilab-modal.min.css' );
        wp_enqueue_style ( 'ilab-media-tools-css', ILAB_PUB_CSS_URL . '/ilab-media-tools.min.css' );
        wp_enqueue_script( 'wp-pointer' );
        wp_enqueue_script ( 'ilab-modal-js', ILAB_PUB_JS_URL. '/ilab-modal.js', ['jquery'], false, true );
        wp_enqueue_script ( 'ilab-media-tools-js', ILAB_PUB_JS_URL. '/ilab-media-tools.js', ['jquery'], false, true );
    }
public function enqueueTheGoods ( $ hook ) { add_thickbox ( ) ; if ( $ hook == 'post.php' ) wp_enqueue_media ( ) ; else if ( $ hook == 'upload.php' ) { $ mode = get_user_option ( 'media_library_mode' , get_current_user_id ( ) ) ? get_user_option ( 'media_library_mode' , get_current_user_id ( ) ) : 'grid' ; if ( isset ( $ _GET [ 'mode' ] ) && in_array ( $ _GET [ 'mode' ] , [ 'grid' , 'list' ] ) ) { $ mode = $ _GET [ 'mode' ] ; update_user_option ( get_current_user_id ( ) , 'media_library_mode' , $ mode ) ; } if ( $ mode == 'list' ) { $ version = get_bloginfo ( 'version' ) ; if ( version_compare ( $ version , '4.2.2' ) < 0 ) wp_dequeue_script ( 'media' ) ; wp_enqueue_media ( ) ; } } else wp_enqueue_style ( 'media-views' ) ; wp_enqueue_style ( 'wp-pointer' ) ; wp_enqueue_style ( 'ilab-modal-css' , ILAB_PUB_CSS_URL . '/ilab-modal.min.css' ) ; wp_enqueue_style ( 'ilab-media-tools-css' , ILAB_PUB_CSS_URL . '/ilab-media-tools.min.css' ) ; wp_enqueue_script ( 'wp-pointer' ) ; wp_enqueue_script ( 'ilab-modal-js' , ILAB_PUB_JS_URL . '/ilab-modal.js' , [ 'jquery' ] , false , true ) ; wp_enqueue_script ( 'ilab-media-tools-js' , ILAB_PUB_JS_URL . '/ilab-media-tools.js' , [ 'jquery' ] , false , true ) ; }
Enqueue the CSS and JS needed to make the magic happen
@param $hook
Enqueue the CSS and JS needed to make the magic happen