Environment Requirements
Prerequisites
Before implementing this snippet, ensure your environment meets the following minimum requirements to ensure compatibility and security.
System Requirements
- WordPress: Version 5.0 or higher.
- PHP: Version 7.4 or higher (Compatible with PHP 8.x).
- Web Server: Apache or Nginx with
mod_rewriteenabled.
Access and Permissions
- File System Access: You must have permission to edit your WordPress theme's
functions.phpfile, or access to a "Code Snippets" plugin to inject the PHP code. - Administrative Privileges: Access to the WordPress Dashboard to add and manage shortcodes within pages, posts, or widgets.
Compatibility Notes
- Themes: This snippet is compatible with both Classic themes and Block themes (FSE).
- User Authentication: The
[user_role]shortcode is designed to work for logged-in users. If a visitor is not logged in, the shortcode will return an empty string or the default fallback defined in the script. - Page Builders: Fully compatible with Elementor, Divi, Beaver Builder, and the Gutenberg Block Editor via the "Shortcode" block.