SlideShare a Scribd company logo
Jonathan Bossenger
Let’s Code
Learn.WordPress.org
Developing WordPress User Roles and Capabilities
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
Learn.WordPress.org
Let's code!
Developing WordPress
User Roles and
Capabilities
Jonathan Bossenger
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.
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/
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.
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
8
Let’s code.
Resources
○ https://github.com/jonathanbossenger/wp-learn-roles-capabilities/releases/download/1.0.0/wp-
learn-roles-capabilities.1.0.0.zip
○ https://developer.wordpress.org/plugins/users/roles-and-capabilities/
○ https://wordpress.org/documentation/article/roles-and-capabilities/
○ https://developer.wordpress.org/reference/functions/current_user_can/
○ https://developer.wordpress.org/reference/classes/wp_role/add_cap/
○ https://developer.wordpress.org/reference/functions/register_activation_hook/
○ https://developer.wordpress.org/reference/functions/get_role/
○ https://developer.wordpress.org/reference/functions/register_deactivation_hook/

More Related Content

PPTX
Let's code: custom content & custom capabilities
PPTX
Debugging in WordPress
PPTX
Developing Blocks without React - Block Supports.pptx
PPTX
Let's code: extending the WP REST API - modifying responses
PPTX
Preventing Common Security Vulnerabilities
PPTX
Let's code: WordPress multisite experiments
PPTX
Preventing CSRF Security Vulnerabilities.pptx
PPTX
Testing plugins for PHP 8
Let's code: custom content & custom capabilities
Debugging in WordPress
Developing Blocks without React - Block Supports.pptx
Let's code: extending the WP REST API - modifying responses
Preventing Common Security Vulnerabilities
Let's code: WordPress multisite experiments
Preventing CSRF Security Vulnerabilities.pptx
Testing plugins for PHP 8

Similar to Let's code: developing WordPress User Roles and Capabilities (20)

PPTX
WordPress Plugin Security
PPTX
Developing for multisite
PPTX
Interacting with the WP REST API
PPTX
Help test WordPress - developer edition
PPTX
Using the WP REST API
PPTX
WP REST API Authentication, custom fields and updating resources
PPTX
Common WordPress APIs - Dashboard Widgets
PPTX
The WordPress Database
PPTX
Common WordPress APIs_ Internationalization
PPTX
Using Block Patterns in your Block Theme.pptx
PPTX
Common WordPress APIs_ Settings API
PPTX
Common WordPress APIs - Options API
PPTX
Internationalisation in Block Themes.pptx
PPTX
Developing Blocks without React - Part 1
PPTX
Custom Tables in WordPress
PPTX
Common WordPress APIs_ Global Variables
PPTX
Common WordPress APIs: Metadata
PPTX
Let's code! Converting a Shortcode into a Block
PPTX
Common WordPress APIs: Responsive Images
PPTX
Testing WordPress 6.3 - Developer edition
WordPress Plugin Security
Developing for multisite
Interacting with the WP REST API
Help test WordPress - developer edition
Using the WP REST API
WP REST API Authentication, custom fields and updating resources
Common WordPress APIs - Dashboard Widgets
The WordPress Database
Common WordPress APIs_ Internationalization
Using Block Patterns in your Block Theme.pptx
Common WordPress APIs_ Settings API
Common WordPress APIs - Options API
Internationalisation in Block Themes.pptx
Developing Blocks without React - Part 1
Custom Tables in WordPress
Common WordPress APIs_ Global Variables
Common WordPress APIs: Metadata
Let's code! Converting a Shortcode into a Block
Common WordPress APIs: Responsive Images
Testing WordPress 6.3 - Developer edition
Ad

More from Jonathan Bossenger (16)

PPTX
New WordPress Developer APIs The Interactivity API
PPTX
The WordPress HTML API
PPTX
The WordPress Create Block tool
PPTX
PHP compatibility testing with PHPCompatibilityWP
PPTX
Common WordPress APIs_ HTTP API.pptx
PPTX
What’s new for developers_ (August 2023).pptx
PPTX
Testing your plugins for PHP version compatibility
PPTX
WordPress Coding Standards
PPTX
Managing a WordPress Multisite Network
PPTX
Introduction to WordPress Multisite Networks
PPTX
Custom Post Types and Capabilities.pptx
PPTX
Developing WordPress User Roles and Capabilities
PPTX
Creating a WordPress multisite network
PPTX
Extending WordPress: common security vulnerabilities
PPTX
WP REST API - custom routes and endpoints
PPTX
WP REST API - modifying responses
New WordPress Developer APIs The Interactivity API
The WordPress HTML API
The WordPress Create Block tool
PHP compatibility testing with PHPCompatibilityWP
Common WordPress APIs_ HTTP API.pptx
What’s new for developers_ (August 2023).pptx
Testing your plugins for PHP version compatibility
WordPress Coding Standards
Managing a WordPress Multisite Network
Introduction to WordPress Multisite Networks
Custom Post Types and Capabilities.pptx
Developing WordPress User Roles and Capabilities
Creating a WordPress multisite network
Extending WordPress: common security vulnerabilities
WP REST API - custom routes and endpoints
WP REST API - modifying responses
Ad

Recently uploaded (20)

PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Encapsulation theory and applications.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Machine learning based COVID-19 study performance prediction
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PPTX
A Presentation on Artificial Intelligence
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
MYSQL Presentation for SQL database connectivity
Programs and apps: productivity, graphics, security and other tools
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Big Data Technologies - Introduction.pptx
Assigned Numbers - 2025 - Bluetooth® Document
Encapsulation_ Review paper, used for researhc scholars
Encapsulation theory and applications.pdf
A comparative analysis of optical character recognition models for extracting...
Digital-Transformation-Roadmap-for-Companies.pptx
Dropbox Q2 2025 Financial Results & Investor Presentation
Machine learning based COVID-19 study performance prediction
Per capita expenditure prediction using model stacking based on satellite ima...
Building Integrated photovoltaic BIPV_UPV.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Diabetes mellitus diagnosis method based random forest with bat algorithm
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
A Presentation on Artificial Intelligence
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)

Let's code: developing WordPress User Roles and Capabilities

  • 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
  • 3. Learn.WordPress.org Let's code! Developing WordPress User Roles and Capabilities Jonathan Bossenger
  • 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
  • 9. Resources ○ https://github.com/jonathanbossenger/wp-learn-roles-capabilities/releases/download/1.0.0/wp- learn-roles-capabilities.1.0.0.zip ○ https://developer.wordpress.org/plugins/users/roles-and-capabilities/ ○ https://wordpress.org/documentation/article/roles-and-capabilities/ ○ https://developer.wordpress.org/reference/functions/current_user_can/ ○ https://developer.wordpress.org/reference/classes/wp_role/add_cap/ ○ https://developer.wordpress.org/reference/functions/register_activation_hook/ ○ https://developer.wordpress.org/reference/functions/get_role/ ○ https://developer.wordpress.org/reference/functions/register_deactivation_hook/

Editor's Notes

  • #2: TITLE SLIDE: Make a copy of this presentation to your Google Drive, and edit to replace with your details.