• Resolved Mauri CS

    (@perupionline)


    Hi!

    I would like to know if it is possible to use the plugin to display in a specific user role (Subscriber). This is my case:

    I have users on my wordpress page who need to see certain data that I must load in some tables (a reservation). user/AAA can only see what belongs to him and user/BBB can see what belongs to him.

    They will not be able to edit them, they will only see what the ADMIN has uploaded.?

Viewing 1 replies (of 1 total)
  • Plugin Support Syed Numan

    (@annuman)

    Hello @perupionline,

    Yes, it is possible to use with custom PHP snippets, but another code snippet plugin needs to be required that provides a shortcode along with the ninja table.

    Here is the PHP snippet and you just need to assign the table ID here. As the table shortcode is assigned in the PHP snippet then you need to embed the shortcode that is provided by the code Snippet plugin on a page. So, only the logged-in user(subscriber) would see the table.

    /*Display table only for subscriber*/
    <?php global $current_user; wp_get_current_user(); ?>
    <?php if ( current_user_can('subscriber') ) {
        $getUsername = $current_user->user_login;
        echo do_shortcode('[ninja_tables id="Your Table ID here"] ');
    }
    ?>

    Thanks

Viewing 1 replies (of 1 total)
  • The topic ‘Viewing for specific user rol’ is closed to new replies.