WordPress plupload не является функцией

Я продолжаю получать следующую ошибку в консоли.

Uncaught TypeError: $ (...). Plupload не является функцией

Я пытаюсь настроить интерфейсную страницу WordPress, на которой зарегистрированные пользователи могут загружать изображения.

Кажется, что-то блокирует этот скрипт. Это сводит меня с ума!

Это поставлено в очередь. У меня есть функция, которая проверяет, что он загружен.

function my_detected_scripts() {
  global $wp_scripts;
  foreach( $wp_scripts->queue as $handle ) :
    echo $handle . ' <br /> ';
  endforeach;
}

echo my_detected_scripts();

Эта функция производит эти js, которые поставлены в очередь.

ssmemberships_js 
jquery 
q-a-plus 
puzzle_reload 
solvemedia_comment_reply 
parallax 
modernizr 
carousel 
tipsy 
fields 
tabs 
jquery_scroll 
supersubs 
superfish 
hoverIntent 
buttons 
ddslick 
main 
googlemaps 
gmap 
bootstrap 
ubermenu 
admin-bar 
plupload-all 
plupload 
jquery-ui-core 
jquery-ui-widget 
jquery-ui-button 
jquery-ui-progressbar 
jquery-ui-sortable 
jquery-ui-tabs 
jquery-ui-autocomplete 
jetpack-photon 
ngg_lightbox_context 
recaptcha 
tml-themed-profiles 
devicepx 
grofiles-cards 
wpgroho 
wp-jquery-lightbox-swipe 
wp-jquery-lightbox 
wpcom-notes-admin-bar 

Я даже не могу загрузить базовую базовую настройку.

Вот что я вставил в файл шаблона для этой страницы.

<h1>jQuery UI Widget</h1>

<p>You can see this example with different themes on the <a href="http://plupload.com/example_jquery_ui.php">www.plupload.com</a> website.</p>

<form id="form" method="post" action="/echo/json">
    <div id="uploader">
        <p>Your browser doesn't have Flash, Silverlight or HTML5 support.</p>
    </div>
    <br />
    <input type="submit" value="Submit" />
</form>

<script type="text/javascript">
$(document).ready(function() {
    $("#uploader").plupload({
        // General settings
        runtimes: 'html5,flash,silverlight,html4',

        // Fake server response here 
        // url : '../upload.php',
        url: "/echo/json",

        // Maximum file size
        max_file_size: '1000mb',

        // User can upload no more then 20 files in one go (sets multiple_queues to false)
        max_file_count: 20,

        chunk_size: '1mb',

        // Resize images on clientside if we can
        resize : {
            width: 200, 
            height: 200, 
            quality: 90,
            crop: true // crop to exact dimensions
        },

        // Specify what files to browse for
        filters: [
            { title: "Image files", extensions: "jpg,gif,png" },
            { title: "Zip files", extensions:  "zip,avi" }
        ],

        // Rename files by clicking on their titles
        rename: true,

        // Sort files
        sortable: true,

        // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
        dragdrop: true,

        // Views to activate
        views: {
            list: true,
            thumbs: true, // Show thumbs
            active: 'thumbs'
        },

        // Flash settings
        flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',

        // Silverlight settings
        silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap'
    });


    // Handle the case when form was submitted before uploading has finished
    $('#form').submit(function(e) {
        // Files in queue upload them first
        if ($('#uploader').plupload('getFiles').length > 0) {

            // When all files are uploaded submit form
            $('#uploader').on('complete', function() {
                $('#form')[0].submit();
            });

            $('#uploader').plupload('start');
        } else {
            alert("You must have at least one file in the queue.");
        }
        return false; // Keep the form from submitting
    });
});
</script>

Я новичок в использовании plupload, и должно быть что-то, о чем не говорится в руководстве по запуску. Тем не менее, WordPress конкретные вещи тонкие.

Пожалуйста, дайте мне знать, что мне не хватает или как я могу загрузить это? Он находится на тестовом сервере, поэтому я не могу дать URL.

Я знаю, что некоторые вещи в конфигурации не являются правильными, но они все равно должны запускать plupload.

Большое спасибо за Вашу помощь!

0 ответов

Другие вопросы по тегам