Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi GuerillaRadio1,

    I’m sorry to hear that. I’ve never used RequireJS myself, but my understanding is that use of it on your site implies you’re loading and managing your JS dependencies. Is RequireJS just being used by another one of your plugins, or have you set it up yourself to manage your project’s dependencies?

    Sorry, I see now in your initial response you indicated that you were using RequireJS yourself in this project. I suspect (but don’t know) that you’ll need to register each of the plugin’s dependencies through RequireJS in some way.

    You’ll find the frontend assets enqueued here. I suspect the source of the problem will be with pickadate.js. A quick Google search will bring up some tips on setting up pickadate with RequireJS.

    Thread Starter GuerillaRadio1

    (@guerillaradio1)

    Thanks for the quick reply.

    I’m still not having any luck. Where are those pickadate scripts being enqueued? I think I should be able to overcome this problem if I enqueue these scripts before require.js, but at the minute they are being enqueued after require.js (see source from just before the closing <body> tag below)

    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.core.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.datepicker.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.widget.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.accordion.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.tabs.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.effect.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/jquery/ui/jquery.ui.effect-pulsate.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-includes/js/comment-reply.min.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/themes/wycliffe/library/js/libs/require.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/themes/wycliffe/library/js/main.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.date.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/picker.time.js'></script>
    <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/lib/simple-admin-pages/lib/pickadate/legacy.js'></script>
    <script type='text/javascript'>
    /* <![CDATA[ */
    var rtb_pickadate = {"date_format":"mmmm d, yyyy","time_format":"h:i A","disable_dates":[],"schedule_open":null,"schedule_closed":null,"early_bookings":null,"late_bookings":null,"date_onload":null,"time_interval":"30"};
    /* ]]> */
    </script>
    <script type='text/javascript' src='http://test.local/wp-content/plugins/restaurant-reservations/assets/js/booking-form.js'></script>

    Hi GuerillaRadio1,

    They’re actually enqueued when the Booking Form is loaded, in /includes/template-functions.php. Check out rtb_enqueue_assets(), which is called early in rtb_print_booking_form();.

    You can easily disable all frontend styles and scripts by filtering rtb-load-frontend-assets. Then you can enqueue them at your own time and place.

    This was resolved over email by enqueuing the assets in the head instead of the footer.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Plugin conflicting with RequireJS’ is closed to new replies.