• Hi. I saw this was added (age_gate/cookie/length) but can you explain how and where we can adjust this? Please explain. Thank you.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Phil

    (@philsbury)

    Hi @garymgordon ,

    Yes it’ll be in the docs shortly (thanks flagging the 404 btw, it’s an odd one that I’m not sure what’s happening).

    Reason I’ve not come back to you is I’ve actually added another one so you can control time and length.

    I have one more bug to look into then I’ll do the release, update the docs with examples and fire the links over to you on this thread.

    Thanks
    Phil

    Plugin Author Phil

    (@philsbury)

    Hi @garymgordon,

    As promised:

    Length and Time docs.

    The time is needs to be days, hours or minutes, then the length is how many of those things you want.

    So, for instance, if you want the session to expire after 30 minutes, you’d do:

    
    add_filter('age_gate/cookie/time', 'set_age_gate_cookie_time');
    
    function set_age_gate_cookie_time($timescale) {
        return 'minutes';
    }
    
    add_filter('age_gate/cookie/length', 'set_age_gate_cookie_length');
    
    function set_age_gate_cookie_time($length) {
        return 30;
    }

    All in either a custom plugin or your themes functions.php.

    Hope that helps.

    Thanks
    Phil

    Thread Starter Gary Gordon

    (@garymgordon)

    Paul,
    Thanks. ??

    Do you think you’ll ever be adding this functionality as a selection within the plugin instead of the need to make a change to the functions.php file? I was just curious. (And if yes, when do you think this might be implemented.)

    Gary

    Plugin Author Phil

    (@philsbury)

    Hi,

    Yeah I had planned for it to be in v3, but I finished up scaling back some of the settings to make it a bit less of a workload.

    I’ve created myself a to-do to add it as options, when I’ll get onto it I’m not sure as there’s a few stabilisations I need to address first. I’m hoping that’ll all be done this week and I can move on to adding more features after that.

    Either way, the filters will stay even if the options are added.

    Thanks
    Phil

    Thread Starter Gary Gordon

    (@garymgordon)

    Phil,

    Awesome. Sounds great. No rush. I was just curious. (Just let us know.)

    The plugin is terrific. Loving it.

    Gary

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘RE: age_gate/cookie/length – how can we use this? Can you explain?’ is closed to new replies.