• Hi,
    I want to create a custom user role as “Web Story Editor” in wordpress. And I want that user role to only get access to Google Web Stories for creating stories.

    I don’t want to use any plugin for creating the user role. Can you please help me with the appropriate code that I can insert in the file?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator bcworkz

    (@bcworkz)

    Use wp_roles() to get the WP_Roles object. You can then add a role with $wp_roles->add_role() where you define what capabilities a role should have.
    https://developer.www.ads-software.com/reference/classes/wp_roles/add_role/

    The capabilities need to be coordinated with however GWS are being stored. If they are in a custom post type, that post type should be registered with unique capabilities that your custom role would utilize.

    Thread Starter Subhro

    (@subhro2321)

    I’m not very friendly with PHP.

    Can you kindly help me with the exact code that will create a custom user role as “Web Story Editor” who will only get access to Google Web Stories?

    It really helps.

    Moderator bcworkz

    (@bcworkz)

    I neglected to mention that the above process has wrapper function, add_role(). On its doc page there are number of examples on adding a role in the User Contributed Notes section.
    https://developer.www.ads-software.com/reference/functions/add_role/

    If you’re not good with PHP, there are a number of roles and capabilities plugins you could use to create roles without needing to write code.

    What is most important is which capabilities are assigned to the role. I don’t know enough about how GWS are implemented to know what capabilities you need. Your current GWS implementation may also need custom capabilities to separate it from the usual post and page capabilities.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to create a user role who can only get access to Google Web Stories plugin?’ is closed to new replies.