Notifications
Clear all

[Solved] icheck.js

6 Posts
3 Users
1 Reactions
1,467 Views
(@sirius)
Member Customer
Joined: 5 years ago
Posts: 23
Topic starter  

Hi,

is there a way to prevent loading of icheck.js only for all the forum since it cause some problem with checkbox?

thank you!


   
 Tom
(@tomson)
Famed Member Admin
Joined: 10 years ago
Posts: 4209
 

Hi @sirius,

It's not possible to stop a JS function from other side. it should be stopped from the JS function side. This is not CSS code to fix by setting !important statement from forum side. There is no way to stop this JS function. You should ask this question to the JS function support or to the support team who use this in own plugin or theme.


   
(@sirius)
Member Customer
Joined: 5 years ago
Posts: 23
Topic starter  

@tomson

yes indeed, sorry for asking 😉
I still managed by css to replace things correctly.

best regards

 


   
Elvina
(@elvina)
Support
Joined: 5 years ago
Posts: 1403
 

@sirius,

You should add the following code in your active theme functions.php file.

add_action('wp_enqueue_scripts', function(){
/** @var string $handle Name of the script to be removed */
$handle = 'YOUR_icheck.js_HANDLE_NAME';
if(is_wpforo_page()) wp_dequeue_script($handle);
}, 999);

The red marked value is the value of the handle name enqueued by wp_enqueue_script(). You just need to find the handle name and put it as a value for $handle variable.
Also, please note that the handle name and handle file name do not match.

You need to find the parametre for enqueued icheck.js file, then use the same parameter for dequeue it.


   
(@sirius)
Member Customer
Joined: 5 years ago
Posts: 23
Topic starter  

@elvina

Hi!

ok great thank you!

I read about dequeue_script yesterday but i didn't have time to get more indeep to learn about it.

Thank you very much for the info, i will work on that

best regards

 


   
(@sirius)
Member Customer
Joined: 5 years ago
Posts: 23
Topic starter  

@elvina

oh yes! thank you so much

manage to find the handle 😉

perfect now, thank a lot!

best regards

 


   
Elvina reacted
Share:
Scroll to top