• Resolved john201502

    (@john201502)


    Hi, Jordy,

    I created three new roles with another plugin. I know the names of the roles(written by myself in Chinese), but I want to get their English names in the code(just like “premium” or “standard”), how can I get them? Which data table does WP store roles in? Thank you~

    dd_filter( ‘mwai_stats_credits’, function ( $credits, $userId ) {

    $user = get_userdata( $userId );

    if ( !empty( $user->roles) && is_array( $user->roles ) )

    { foreach ( $user->roles as $role)

    { if ( $role === ‘premium’ )

    { return 50; }

    if ( $role === ‘standard’ )

    { return 10; } } } // This will be basically the default value set in the plugin settings // for logged-in users.

    return $credits; }, 10, 2);

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter john201502

    (@john201502)

    Resolved,please ignore the question above.

    Could you please tell me the shortcode for Site-Wide chat?thanks.

    Plugin Support Val Meow

    (@valwa)

    Hello @john201502 ,

    I’m glad to hear that you were able to resolve the issue on your own. If you’d like to enable site-wide chat, you can do so by navigating to the “Chatbot” tab and selecting the desired chatbot from the dropdown menu labeled “Site-Wide Chat.” This will allow you to apply the chosen chatbot across your entire site.

    Hope this helps ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to know the user’s role?’ is closed to new replies.