Support » Plugin: Invite Anyone » Feature Request: Access test filter

  • Resolved Ben Byrne

    (@drywallbmb)


    Hi there,

    Would it be possible to add an apply_filters() call to the return of the invite_anyone_access_test function? I love that this plugin provides some controls to administrators for limiting access, but those controls don’t quite match my needs. If the access test return value were filterable, I could hook into it to perform the check I need to.

    E.g. line 394 of by-email.php could be changed from:
    return true;
    to something like:
    return apply_filters( 'invite_anyone_access_test', true );

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Boone Gorges

    (@boonebgorges)

    Sure thing. I agree this would be useful.

    The way the function is currently written is pretty clunky. I’d have to put apply_filters() on every single return value. Ideally, it’d all be returned in a single place, but this’ll require a full refactor.

    I’ve opened a GitHub ticket to track the issue. If you fancy having a go at a PR, please feel free https://github.com/boonebgorges/invite-anyone/issues/153. Otherwise, I’ll try to do it for the next release.

    Come to think of it, probably all the return calls in advance of that filter running should be changed to set a variable, then run that variable through the filter… I actually need to filter it when $iaoptions['email_visibility_toggle'] is set to 'no_limit' but the function has already returned by that point.

    Ha, disregard my comment, you already thought of it!

    I’ll have a go at a PR, this will make my life massively easier. 🙂

    PR accepted and merged, closing this thread to reflect that it’s being handled. w00t.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Feature Request: Access test filter’ is closed to new replies.