Support » Plugin: Eonet Manual User Approve » woocommerce compatibility

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’ve written some code that will do this – mine is very tied up in the specifics I’m building for my site, but here’s the bare bones of it. May require some debugging as I’ve not tested this stripped-down version.

    Pasted below but also here to retain indents for legibility: https://pastebin.com/m9fNFUDP

    function wp4625_handleuserstates()
    {
    if(is_user_logged_in())
    {
    if(current_user_can(‘administrator’) || current_user_can(‘editor’) || current_user_can(‘edit_posts’))
    {
    // The user is an Admin, Editor or other WP user with permission to edit pages
    }
    else
    {
    // get user status data from Eonet Manual User Approve plugin
    $userapproved=get_user_meta( get_current_user_id(), ‘eonet_mua_status’ );

    if(is_array($userapproved))
    {
    if($userapproved[0]==1)
    {
    // an approved user
    }
    else if($userapproved[0]==0)
    {
    // a pending user – ensure they are logged out!
    wp_logout();
    }
    else
    {
    // a disapproved user
    }
    }
    else
    {
    // something unexpected happened
    }
    }
    }
    }
    add_action(‘template_redirect’, ‘wp4625_handleuserstates’);

    • This reply was modified 2 years, 5 months ago by  ahcferret.
    • This reply was modified 2 years, 5 months ago by  ahcferret. Reason: added pastebin link
    Plugin Author antonioeatgoat

    (@antonioeatgoat)

    Thank you so much guys for your signalation and your code. I’ll test it further and I’ll add a check in the next version of the plugin 😉

    Regards.

    Totally welcome to it!

    This is a really important feature! Just what I’m looking for!
    Can you give a date when a new version is coming up with this fix?
    Thanks for this great plugin, by the way.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘woocommerce compatibility’ is closed to new replies.