WP Rocket - WordPress Caching Plugin

Show admin notice to a specific user or user role [No Code]

Show admin notice WordPress

The scenario

Show admin notice ( message on the admin dashboard ) to a specific user or user role to tell them the contribution guidelines or tell them about their to-do list for example.


Pre-requisites ( needed plugins )

You need to install the Business rules ( Workflow ) WordPress plugin to easily manage this workflow without any coding experience, just some mouse clicks and you will be ready.

The Business rules plugin is a workflow WordPress plugin that allows site administrators to define conditionally executed actions based on occurring events.


Steps to show admin notice to one role (editors for example)

  1. Create a new Business rule, from admin dashboard.

2. Choose a title for this business rule (workflow)


3. Choose admin initialize trigger


4. At the conditions area, you need to click on Add New Condition


5. Select Current logged-in user role condition


6. Choose the role you need to show the notice to, in our case, we will choose Editor.


7. At the actions area, click on Add New Action


8. Choose the action Show admin notice


9. Fill the required fields as follows:

Notice type: if this notice is an error, warning, success, or info message.

Dismissable: if you want the user to dismiss this notice, or you need it to be there forever.

Admin notice contents: The message itself you need to show.


10. Publish the rule and test it by logging in as an editor to check if you can see the notice or not.



Steps to show admin notice to one user

  1. Create a new Business rule, from admin dashboard.

2. Choose a title for this business rule (workflow)


3. Choose admin initialize trigger


4. At the conditions area, you need to click on Add New Condition


5. Select Current logged-in user condition


6. Choose the user you need to show the notice.


7. At the actions area, click on Add New Action


8. Choose the action Show admin notice


9. Fill the required fields as follows:

Notice type: if this notice is an error, warning, success, or info message.

Dismissable: if you want the user to dismiss this notice, or you need it to be there forever.

Admin notice contents: The message itself you need to show.


10. Publish the rule and test it by logging in with the selected user to check if you can see the notice or not.


Summary

In this tutorial, we learned how to show an admin notice to one user role and to a specific user using the Business rules (Workflow) WordPress plugin.

Leave a Reply

Your email address will not be published. Required fields are marked *