The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
wp_register_script ...
 
Share:
Notifications
Clear all

Question [Solved] wp_register_script - wpdiscuz-combo-js - 'strategy' => 'defer' ?

2 Posts
2 Users
0 Reactions
349 Views
Posts: 1
 JDO
Topic starter
(@jdo)
New Member
Joined: 7 months ago

What is the reason that the wpdiscuz-combo-js is >not< registered  with 'strategy' => 'defer' (or at least configureable) ?

I had some problems with "ReferenceError: jQuery is not defined at wpdiscuz-combo.min.js?ver=7.6.19:8:1", which are solveable with using defer.

1 Reply
Asti
Posts: 7664
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi,

You can use the hook code below. It allows you to add the attributes you want to any js code: 

add_filter('script_loader_src', 'custom_script_loader_src', 10, 2);
function custom_script_loader_src($src, $handle) {
    if ($handle !== 'wpdiscuz-combo-js') {
        return $src;
    }
    return $src . "'&nbsp;defer";
}
Share: