Potential Bug: blockRoleFromAdmin blocks ajax for those roles

Home Forums Calendar Products Community Events Potential Bug: blockRoleFromAdmin blocks ajax for those roles

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #29160
    Kyle
    Participant

    I was having some trouble with the community events feature for blocking certain roles from the admin. The function does a simple if (is_admin()) but the problem is that this may block frontend ajax functions that call the wp-admin/admin-ajax.php file, which happened to me. E.g. I have an ajax call that checks for Event ‘overlap’ to prevent double bookings, but I blocked authors from backend, so the function did not work for author-users.

    Something like this may work better: http://pastie.org/5498781

    function is in /lib/tribe-community-events.class.php line 2748. Love the plugins! Hope this helps others in the community.

    #29161
    Kyle
    Participant

    Code is courtesy of the WP Block Admin plugin http://wordpress.org/extend/plugins/wp-block-admin/

    #29187
    Casey
    Participant

    Kyle,
    Thanks so much for posting this. I’ll pass this along to our developers.

    #49033
    Casey
    Participant

    Kyle,
    I just heard back from our developers and he said this would be the proper way to do it: http://pastebin.com/0meag0mC

    Hope that helps!

    #979115
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Potential Bug: blockRoleFromAdmin blocks ajax for those roles’ is closed to new replies.