• Resolved dimizu

    (@dimizu)


    First of all, thanks for the great plugin!

    I am using Restrict User Access version 2.2.23 with WordPress 6.4.3 and PHP 7.4.

    Now I am trying to use your API.

    This works:
    $wp_user=new WP_User(2);
    $rua_user=rua_get_user($wp_user);
    $rua_level=rua_get_level(83);
    $rua_level_by_name=rua_get_level_by_name(“k01”);

    But this:
    $rua_level_members=rua_get_level_members($rua_level);
    $rua_level_cap=rua_get_level_cap(83);
    $rua_level_members=rua_get_level_members($rua_level);

    Does not work.

    I get
    PHP Fatal Error: Uncaught error: Class ‘WPCAMeta’ not found in …\wp-content\plugins\restrict-user-access\level.php:334

    I’m not sure if I’m using your API incorrectly. Can you give me 1 or 2 working examples?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter dimizu

    (@dimizu)

    Sorry: Restrict User Access version 2.2.23 it’s wrong, it is Version 2.6.1

    Plugin Author Joachim Jensen

    (@intoxstudio)

    Hi,

    Your use of the API looks correct to me. However, there is currently a limitation in the API so (parts of it) are only available after the WP action “plugins_loaded” has finished.

    The error you are seeing basically means that it’s expecting a dependency that hasn’t been loaded yet.

    Can you give me some more details about what you’re trying to use the API for?

    Thread Starter dimizu

    (@dimizu)

    I have been testing your plugin for a client project. But in the end I created the project without your plugin. But I appreciate your feedback. Maybe I will use your plugin in the future.
    Thanks for the feedback.
    I understand your answer: “after the WP action plugins_loaded has finished”. I will keep it in mind.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘API Restrict User Access’ is closed to new replies.