0

I created a WordPress plugin but when i activate it my customizer and its preview stop working. I have attached a screenshot below.

I have tried to increase my memory to 8000M but it wasn't useful.

Below is the screenshot of what i see in customizer Customizer view Update: Thanks to @JacobPeattie i was able to find that there is something wrong with the scriptStyle(). Please let me know if you see any error in the code.

function scriptStyle() {

    // all scripts
    wp_register_script('jquery_js', 'https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js');
    wp_enqueue_script('jquery_js');
    wp_register_script('jquery_datatables_js', '//cdn.datatables.net/1.10.20/js/jquery.dataTables.min.js');
    wp_enqueue_script('jquery_datatables_js');
    wp_register_script('popper_js', 'https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js');
    wp_enqueue_script('popper_js');
    wp_register_script('sub_bootstrap_js', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js');
    wp_enqueue_script('sub_bootstrap_js');

    // all styles
    wp_register_style('jquery_datatables_css', '//cdn.datatables.net/1.10.20/css/jquery.dataTables.min.css');
    wp_enqueue_style('jquery_datatables_css');
    wp_register_script('dataTableInitilize', plugins_url('js/dataTableInitilize.js', __FILE__, '', true));
    wp_enqueue_script('dataTableInitilize');

    wp_register_style('sub_bootstrap_css', 'https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css');
    wp_enqueue_style('sub_bootstrap_css');

    wp_register_style('gb-subcriber', plugins_url('css/gb-subcriber.css', __FILE__));
    wp_enqueue_style('gb-subcriber');
}
add_action('admin_enqueue_scripts', 'scriptStyle');

Update 2: The issue is coming when i load jquery.min.js

the console is showing "Uncaught TypeError: Cannot read property 'mouse' of undefined" and many other property but if I remove the jquery_js my jquery doesn't work.

  • It could be anything. There’s not enough information in your question. You likely have a coding error somewhere. I can only suggest removing bits of code until it works, at which point you’ll know the culprit. – Jacob Peattie Nov 1 at 8:21
  • ok i will try that. Meanwhile what additional information i can add? – Pratik Purohit Nov 1 at 8:32
  • Thank you @JacobPeattie – Pratik Purohit Nov 1 at 9:21
  • @PratikPurohit Welcome. Please check your browser console and attach any possible errors. It is helpful to find the source of the problem. – Hector Nov 1 at 10:24
  • have updated the issue do you know anyways to resolve the conflict. – Pratik Purohit Nov 1 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.