• Resolved Nur Muhammad

    (@b-muhammad)


    Hi, I am having difficulty penetrating the restrict level plugin’s php documentation. What i would like to do is to implement the shortcode [restrict level=”level_name”] in a php function. I found this condition in the wp documentation:
    if(rua_get_user()->has_level($level_id)) { … }
    but as i uderstand one has to enter and integer id, and i would like to enter the level name, as in the shortcode.
    Can you please help me to find the correct function to use?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Apologies for the delayed response here.

    You can use this method to retrieve the ID by name, and then pass in the ID to your existing code:

    $level_id = rua_get_level_by_name('level-name');

    I have the same problem, I use version 2.4.3. , I have entered levels to access specific pages of woocommerce, but only if I put administrator I can access, if I use another role when I try to access me by as error continuous redirects , and does not work how can I solve? thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restrict access level name / id’ is closed to new replies.