• Resolved scorpiock

    (@scorpiock)


    Hello,

    Thanks for the fantastic plugin.

    I am wondering if there is a way to disable loading CSS/JS files on the front-end? I intend to use only through WP backend.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Kim L

    (@kimmyx)

    Hi @scorpiock,

    We’re happy to know you’re enjoying WP Data Access! ??

    You can disable the loading of CSS/JS scripts on the front-end by going to WP Data Access > Settings > Data Tables.

    Scroll to the bottom and you’ll see the “jQuery DataTables” and “jQuery DataTables Responsive” options.

    See here: https://share.zight.com/Z4u248zy

    Hope that helps! Let us know if you need anything else.

    Thread Starter scorpiock

    (@scorpiock)

    Thank you, Kim, for the prompt response. I changed the setting to load on back-end only, but it still shows loading on page source.

    <link rel="stylesheet" id="wpda_wpdp_public-css" href="https://geekflare.com/wp-content/plugins/wp-data-access/public/../assets/css/wpda_public.css?ver=5.4.0" media="all" />
    <script id="wpda_rest_api-js-extra">
    var wpdaApiSettings = {"path":"wpda"};
    </script>
    <script src="https://geekflare.com/wp-content/plugins/wp-data-access/public/../assets/js/wpda_rest_api.js?ver=5.4.0" id="wpda_rest_api-js"></script>
    

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @scorpiock,

    Thanks for the response.

    wpda_public.css only contains styling for the project icon on the admin toolbar. See here: https://share.zight.com/NQuBG7Rj

    This is for whenever you choose to have a shortcut of your project from the admin toolbar.

    If you still wish to stop these scripts from getting enqueued, you can try to dequeue them by adding a function to your theme’s function.php file.

    To dequeue the style:

    add_action( 'wp_enqueue_scripts', 'mywptheme_child_deregister_styles', 11 );
    
    function mywptheme_child_deregister_styles() {
    	wp_dequeue_style( 'wpda_wpdp_public' );
    }

    To dequeue the script:

    function wpdocs_dequeue_script() {
    	wp_dequeue_script( 'wpda_rest_api' );
    }
    add_action( 'wp_print_scripts', 'wpdocs_dequeue_script', 100 );

    Please try the above and let us know if that works. ??

    Thread Starter scorpiock

    (@scorpiock)

    Thank you so much! that worked.

    Plugin Contributor Kim L

    (@kimmyx)

    Hi @scorpiock,

    You’re welcome! ?? I’ll mark this thread as closed now.

    Feel free to create a new thread if you have new questions.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Disable loading CSS/JS on frontend’ is closed to new replies.