This document provides an introduction to a live coding session on developing WordPress user roles and capabilities. The session will cover how roles and capabilities work in WordPress, how to assign capabilities to existing roles and create custom roles. Participants are instructed to install a test bed plugin and set up their local development environment before the session. The session objectives are outlined as reviewing the plugin, WordPress roles and capabilities, inspecting the user roles array, assigning admin capabilities to the editor role, and creating an assistant role.
2. 2
👋🏽
Welcome!
As you join, please make sure you have your local
development environment ready:
• A local WordPress installation
• A code editor like VSCode or Sublime
• The test bed plugin
• https://github.com/jonathanbossenger/wp-learn-
roles-capabilities/releases/download/1.0.0/wp-
learn-roles-capabilities.1.0.0.zip
Then, let everyone know in the chat where you’re joining
us from…
Hello!
○ My name is Jonathan Bossenger
○ From Cape Town, South Africa
○ Developer educator at Automattic
○ Sponsored to work with the Training Team
○ jonathanbossenger.com
4. Announcements
○ Welcome, and thank you to Tracy for co-hosting.
○ Please let me know if you can’t see this slide!
○ We are presenting in focus mode, but please feel free to enable your video.
○ You are welcome to ask questions.
○ You are welcome to post questions in the chat, or unmute to ask questions.
5. Announcements
○ Make sure your local install is ready
○ https://github.com/jonathanbossenger/wp-learn-roles-
capabilities/releases/download/1.0.0/wp-learn-roles-capabilities.1.0.0.zip
○ If I am going too fast, please let me know!
○ We will be posting this session to https://wordpress.tv/ afterwards
○ For more WordPress focused content please visit https://learn.wordpress.org/
6. Learning Outcomes
1. How Roles and Capabilities work.
2. Understanding how roles and capabilities are stored, and can be checked against.
3. How to assign capabilities to an existing role.
4. How to create a custom role and assign capabilities to it.
7. Objectives
1. Setup and review the test bed plugin
2. Review the WordPress Roles and Capabilities
3. Inspect the user_roles serialized array that is created when WordPress is installed
4. Assign admin specific capabilities to the Editor user
5. Create an Assistant role and assign admin specific capabilities to it
7