Customising Client Notices
When a client completes an action via the Client Zone, more often than not a notice is displayed on the screen to confirm that the action was completed.
To customise these messages, you need to hook into the mdjm_messages
filter. Before doing so, you need the name of the messages you wish to customise. You can obtain this via your browsers address bar after completing an action (&mdjm_message=contract_signed for example), or from the file /includes/misc-functions.php. Search for theĀ mdjm_messages function.
Let’s go ahead and customise theĀ contract_signed message that is displayed above.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
/** * Customise client notices within Client Zone. * * @param arr $messages Array of default messages we can filter * @return arr Filtered $messages. */ function mdjm_custom_notices( $messages ) { $messages['contract_signed'] = array( // Adjust the key for the relevant notice you want to change. 'class' => 'success', // Possible values are info, success, warning, error, validation or your own custom css class. 'title' => __( 'Thanks!', 'text-domain' ), 'message' => __( 'Your contract has been successfully signed and your event is now confirmed. An email will arrive in your inbox in the next few minutes to confirm.', 'text-domain' ) ); return $messages; } // mdjm_custom_notices add_filter( 'mdjm_messages', 'mdjm_custom_notices' ); |
Now, when the client sign’s their contract, the notice they see on the screen will be displayed as;
To change the style of the notice, you can adjust the class above to your own custom CSS class.