• Resolved woomigrating

    (@woomigrating)


    Hi,

    I need to disable age gate when the user agent contains a certain word.

    I’m thinking it could be done either by using some wildcard in the “Custom bots” field if that would work?

    Or by a snippet preventing age gate from loading if some condition is met, if there is such a hook?

    Would much appreciate any help!

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

    (@philsbury)

    Hi @woomigrating,

    It you know the full user agent, the the custom bots should work. That doesn’t’t support any wildcarding at this time.

    There’s a few restriction based filters, probably the best one for you would be age_gate_restricted. Here’s an example:

    
    add_filter('age_gate_restricted', function($restricted, $meta) {
      if (...) { // your test
        return false; //your test matches, so don't restrict
      }
      return $restricted; // return whatever we were passed if above doesn't evaluate
    }, 10, 2);
    

    Thanks
    Phil

    Thread Starter woomigrating

    (@woomigrating)

    12 minutes to answer, that’s impressive!

    Also the filter seems to work perfect, thanks a lot!!!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom user agent’ is closed to new replies.