<?php
// Exit if accessed directly
defined( 'ABSPATH' ) or die( 'Cheatin&#8217; uh?' );

function YMVI_load_import_videos_data(){
    if ( ! wp_verify_nonce( $_POST['nonce'], 'ajax-nonce' ) )
        wp_die ( 'Busted!');
    
    $data = array(
        'objectL10n'     => YMVI()->get_objectL10n(),
        'videosLimit'    => xbox_get_field_value( 'ymvi-options', 'search-results' ),
        'youtubeApiKey'  => xbox_get_field_value( 'ymvi-options', 'youtube-api-key' ),
        'WPCats'         => YMVI()->get_wp_cats()
    );
    wp_send_json( $data );
    wp_die();
}
add_action('wp_ajax_YMVI_load_import_videos_data', 'YMVI_load_import_videos_data');