Add this code to your functions.php
to add a notice for users with the subscriber
role on their profile and dashboard admin pages.
function wpse239290_user_welcome_notice() {
// Make sure that the user is assigned to the subscriber role, specifically.
// Alternatively, capabilities can be checked with current_user_can(), but roles are not supposed to be checked this way.
$user = wp_get_current_user();
if ( ! in_array( 'subscriber', $user->roles ) ) {
return;
}
// Make sure the profile or dashboard screens are being viewed.
$screen = get_current_screen();
if ( ! $screen || ( 'profile' !== $screen->id && 'dashboard' !== $screen->id ) ) {
return;
}
// Show a friendly green notice, and allow it to be dismissed (it will re-appear if the page is reloaded though).
$class="notice notice-success is-dismissible";
// Customize the HTML to fit your preferences.
$message="<p>Looking for the <a href="http://example.com/form">Example Form</a></p>";
printf( '<div class="%1$s"><div class="subscriberProfile">%2$s</div></div>', $class, $message );
}
add_action( 'admin_notices', 'wpse239290_user_welcome_notice' );