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.

Contract Signed Client Notice

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.

 * 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;

Customised Contract Signed Client Notice

To change the style of the notice, you can adjust the class above to your own custom CSS class.


Replacing the Term ‘Event’

MDJM Event Management is exactly that, an Event Management tool, however you may choose to use a different term than Event and in doing so, you will want your new term used throughout the admin and front end (Client Zone) pages rather than seeing the term Event.

Let’s assume that rather than using the term Event, your business uses Party and you want Party or Parties to be used throughout your website.

You can accomplish this by adding the following code into your themes functions.php file.

 * Replaces the term Event with the selected singular and plural phrases.
 * @param    array    $labels    Existing terms.
 * @return   array    $labels    Filtered terms.
function mdjm_change_event_name( $labels ) {

    $labels = array(
        'singular' => __( 'Party', 'your-domain' ), // Replace with your preferred singular name
        'plural'   => __( 'Parties', 'your-domain' ) // Replace with your preferred plural name

    return $labels;

} // mdjm_change_event_name
add_filter( 'mdjm_default_events_name', 'mdjm_change_event_name' );