I am looking for a way to achieve the following:
-
A group of users ‘students’
-
They login to the site
-
Each student can see a ‘Custom Dashboard Widget(s)’
-
Each widget will carry a personal message wrote by Admin for that
logged-in student. Such as A] Total Days in the course B] Total
attendance C] paid & due fees.
Is it possible with WP or should we look for another CMS to achieve these?
This can be solved using custom meta fields in the user profile (only visible to administrators) and then making an individual dashboard widget containing this meta (only visible if certain criteria is met).
Adding fields to the user profile page can be done:
1) manually
Following Justin Tadlock’s tutorial: Adding and using custom user profile fields
Using this Q&A to hide the fields for non-admin users
Following Frank Bültge’s tutorial: Add WordPress Dashboard Widgets
2) by a plugin
The previous Answer used another plugin, but the Comments thread explains the change.
Appart from being well coded and maintained, Advanced Custom Fields is incredibly handy.
2a) Setting up Custom User Fields
click to enlarge
2b) Administrator editing an user
/wp-admin/user-edit.php?user_id=7
2c) Non-admin users viewing the Dashboard
The following will display (or not) each user a personalized message.
Results in:
Bonus code
Adding a bit of UX into ACF: show/hide the Message Textbox if the Enable Message Checkbox is checked or not.
It’s better to change the order of the fields in ACF config, first checkbox then textbox.