Support » Plugin: One Click Demo Import » Limit Predefined Demos to Custom Role

  • Resolved rapidasia

    (@rapidasia)


    Hi – thanks for this useful plugin

    Is there a way to limit particular predefined demos to custom user roles?

    My use case is a WordPress Multisite Network

    If I assign a user role “admin1” I’d like them to have one set of demo imports/recommended plugins

    If I assign a user role “admin2” I’d like a different demo

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi @rapidasia,

    you can conditionally register the predefined demos. So in the ocdi/import_files hook, just check for the user role and register the subset of predefined demos that you wish that particular user role should have.

    So in this code example here, you should just add a few conditional blocks and return the array of demos you need for certain conditions.

    Have a nice day!

    Thread Starter rapidasia

    (@rapidasia)

    awesome support, thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.