Hi @rayeason
Thanks for using our plugins.
You can add the following snippet to your functions.php:
add_filter( 'gdpr_init_script_delay', 'gdpr_delay_script_execution', 20, 1 );
function gdpr_delay_script_execution( $ms ) {
return 5000; // 5000 ms = 5 seconds.
}
Hope this helps.
Will this get removed when the plugin or theme is updated?
Hi @rayeason
It should not get overwritten if your theme is properly coded.
Hope this helps.
@mooveagency
I’ve just seen this snippet looking for a simillar solution but the opposite.
What is the default delay on script execution?
I would like to reduce this delay so the popup appears instantly.
If I change the delay to zero as below will this work?
add_filter( 'gdpr_init_script_delay', 'gdpr_delay_script_execution', 20, 1 );
function gdpr_delay_script_execution( $ms ) {
return 0; // 0 ms = 0 seconds.
}
Hi @thomasjarvisdesign
Thanks for using our plugins.
Yes, the snippet with “0” value will remove the delay and the GDPR banner becomes visible once the JS is loaded by the browser.
Hope this helps.