• Resolved gioma68

    (@gioma68)


    Hi, I’m writing a wrapper to create a custom REST endpoint (using WP REST API interface) for an external app that must use some admin WP functions included APPROVAL/DENY user access using EONET MUA plugin.
    How I can use tha UAM classes in my piece of code? I’ve tried this $user_manager = new Eonet_MUA_UserManager($userid); but I alway receive error PHP Fatal error: Uncaught Error: Class 'Eonet_MUA_UserManager' not found in .../function.php

    Thanks for any help/suggestion.

    • This topic was modified 7 years, 8 months ago by gioma68.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author antonioeatgoat

    (@antonioeatgoat)

    Hello gioma68,

    I am sorry for the late, I hope this would be still helpful.

    You can use the fully qualified name:

    new \ComponentManualUserApprove\classes\Eonet_MUA_UserManager();

    or include the namespace at the start of your file:

    //Include the class
    use ComponentManualUserApprove\classes\Eonet_MUA_UserManager;
    
    // Use the class
    new Eonet_MUA_UserManager();
    • This reply was modified 7 years, 7 months ago by antonioeatgoat. Reason: Details added
    Thread Starter gioma68

    (@gioma68)

    Thanks Antonio, it works!!

    Plugin Author antonioeatgoat

    (@antonioeatgoat)

    You are welcome ??

    If you like the plugin or the support, can you please spend one minute voting it?

    Thank you so much in advance ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to reuse MUA classes in custom function.php’ is closed to new replies.