What is it?
In a nutshell Blocks by User Role for WordPress is a plugin that allows you to show or hide content inside Gutenberg blocks. It is done based on the user role of the visitor, and a wide range of other filters. Some of the filters can be used in combination to create dynamic conditional behavior, and others are simple yet powerful stand-alone filters.
You can insert pretty much any content type inside the block provided by Blocks by User Role. The examples below are to show you each of the filters, how you can use them individually and together.
Select whether you want to show block or hide block and then choose which platforms you want to apply the selected behavior too.
Below you see different colored boxes and text depending on whether you are viewing the page using desktop, tablet, or phone.
You see this purple box because you are viewing the page on your desktop. If you view the page on a tablet or phone, you see a different color and message.
User Role and Capabilities
Use the User Role and Capabilities filter in combination with the Filter Behavior where you choose whether you want to show block or hide block. Select the user role(s) you want to either show block or hide block. Custom user roles added by third-party plugins are also supported.
If you want, you can choose to add a specific capability that the user needs.
Below you see different colored boxes and text depending on whether you are an Editor or Author. If you have neither of the user roles, you don’t see anything.
Login using the following credentials:
You see this dark grey box because you are viewing the page without being logged in. If you view the page while logged in as an Editor or Author, you see different boxes.
Blocks by User Role supports third-party plugins like the official extensions:
Visit the Shop and test-purchase the Membership or Subscription product, and you can experience how Blocks by User Role works.
The WooCommerce™ logo and logo variations are the property of WooCommerce® and the owner retains all rights afforded by US and international Law. There is no official relationship or endorsement between the trademark owner and RightHere LLC or our plugin Blocks by User Role for WordPress.
Select whether you want to show the content in the block to users that are logged in or not logged-in, and you can add an optional username if you wish to restrict this to specific users.
You can use the same login credentials as listed under the User Role and Capabilities section to test this filter.
You see this red box because you are viewing the page while not logged in. If you view the page while logged in, you see a green box.
Restrict Block Settings
Restrict Block Settings is one of the filters which you use in combination with other filters.
Instead of hiding the blocks, you can choose to lock the blocks and show an overlay with a lock on. This way, the visitor can see that some content is restricted. You can choose to redirect to log in or a custom redirect. Choose the color of the overlay and the icon.
Login using the following credentials:
Date, Time, and Weekday’s
The Date, Time, and Weekday’s filter allow you to show or hide content in blocks on a specific date, time, and weekday.
You can use the date and time filter alone, and you can use the weekday filter alone or use both in combination.
Below you will see different content depending on the day of the week and time.
Sunday sleep until you are hungry.
Then eat until you are sleepy.
The Template Tags is WordPress Conditional Tags used to alter the display of content depending on the conditions that the current page matches.
Example if you check the Template Tags filter and check the is_front_page, the content is visible or hidden depending on what you have selected in Filter Behavior when you insert the block on the Front Page.
The Block Animation filter allows you to add animation to your Block. Choose between more than 76 different CSS animation effects. Subtle motion and animation can enhance design without being too distracting. The animations apply to all content in the Block. You can easily add a subtle effect to any element, making it more appealing to the visitors.
We hope you liked this little demo of the features in our new plugin Blocks by User Role for WordPress. Remember that you can place any content or third-party blocks inside the block placeholder and apply the filters.