Viewing 7 replies - 1 through 7 (of 7 total)
  • MA

    (@gasparnemes)

    Hi there,

    You can add the following code snippet to your theme functions.php to enable the strictly necessary cookies by default, if you need other cookies to be enabled by default, set the value from “false” to “true”:

    function moove_gdpr_script_extension() {
       	wp_add_inline_script(
    	   	"moove_gdpr_frontend",
    	   	"jQuery(document).ready(function(){
    			jQuery(this).moove_gdpr_save_cookie({
    				thirdParty: false,
    				advanced: false
    			});
    		});",
    		"after"
    	);
    }
    add_action( 'wp_enqueue_scripts', 'moove_gdpr_script_extension', 999 );

    I hope this helps.

    I was looking for this code and it works fine, thanks! But enabling cookies (any category) by default causes another problem: if a user refreshes the page without clicking accept, the banner disappears (obviously, because the plugin “recognizes” that the necessary cookies are accepted and it can save the settings). Is there a way to stick the banner until a user click accept, even if there are cookies enabled by default?

    Thread Starter agsig

    (@agsig)

    This is ok for now, but as Lofra explains, its not ideal as the bar disappears.

    Will you be building this feature in later on?

    It would be graet if the Strictly Necessary button could be green in the plugin, without the possibility to turm this of.

    The code works fine, when I’m logged in. But when I do not log in it is red again????

    I see no changes with this code

    Same as @hatschiii: I cannot see any changes with this code. ??
    Does it need to be updated?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Enable Strictly Necessary by Default’ is closed to new replies.