1. Home
  2. Developers
  3. Code examples
  4. How to Personalise the Client Portal

How to Personalise the Client Portal

You are running the Client Portal, but want to find a way to modify the Dashboard message, perhaps give it a bit of personalisation like Hi, Mike welcome to your dashboard.

The below code example will do that via the dashboard content filter.

<?php
/*
Plugin Name: Zero BS CRM Portal Filter Plugin
Plugin URI: https://zerobscrm.com
Description: Zero BS CRM is the simplest CRM for WordPress. Customise the Dashboard welcome message with this plugin.
Version: 1.0
Author: Zero BS CRM
Author URI: https://zerobscrm.com
Text Domain: zero-bs-crm
*/

add_filter('zbs_portal_dashboard_content', 'zeroBS_custom_portal_dashboard_filter');
function zeroBS_custom_portal_dashboard_filter($dashboard){
#} simple check if core active
if(class_exists('ZeroBSCRM')){
$uid = get_current_user_id();
$uinfo = get_userdata( $uid );
$cID = zeroBS_getCustomerIDWithEmail($uinfo->user_email);
if($cID > 0){
//again if we have a contact returned, get the meta
$customer_meta = zeroBS_getCustomerMeta($cID);
$dashboard = "<p>";
$dashboard .= "Hello " . $customer_meta['fname'] . ", welcome to your Dashboard";
$dashboard .= "</p>";
return $dashboard;
}
return $dashboard;
}
}
?>

The above will check whether the core is active, and then only modify the dashboard if we have a contact ID linked to the logged in WP user.

Updated on April 15, 2019

Was this article helpful?

Still not found an answer?
If you've searched the knowledge base and still can't find a solution, please submit a ticket.
CONTACT SUPPORT

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.