Menu Close Menu
Menu
  • 0
    • Number of items in cart: 0

      • Your cart is empty.
      • Total: $0.00
      • Checkout
  • Pricing
    • Purchase Options
    • Individual Extensions
  • Support
    • Documentation
    • Log a Support Ticket
  • Your Account
    • Register
  • Blog

How to Change Front End Messages

How to Change Front End Messages

Replace default customer notices with your own custom text

KB Support has a number of built-in messages that are displayed to customers during various activities taking place on the front end of your website – for example, when a ticket is submitted. We’ll refer to these messages as notices.

These front end notices can be changed if you want to do so with a small amount of code by hooking into the kbs_get_notices filter.

All notices are stored as an array within the kbs_get_notices() function. The array key is the ID of the notice and it is necessary for you to know the ID in order to adjust a specific notice.

The array values are nested inside further array associated with the ID;

  • class – This is the CSS class applied to the notice. Default styling allows for three values;

    Example notice with success class

    Example notice with error class

    Example notice with info class

  • notice – Defines the text that is displayed as the notice

An example of this array is as follows;

array(
    'need_login' => array(
        'class'  => 'info',
        'notice' => sprintf( __( 'You must be logged in to create a support %s.', 'kb-support' ), kbs_get_ticket_label_singular( true ) )
    )
);

As already mentioned, it is possible to change the values within this array in order to display custom messages to your customers. In the below example, we will change the need_login notice and customise the text.

Example

function kbs_custom_frontend_notice( $notices ) {
    $notices['need_login'] = array(
        'class'  => 'info', // Maintain blue container and text
        'notice' => __( 'Sorry but you need to be logged in to create a new support case.', 'kb-support' )
    );

    return $notices;
}
add_filter( 'kbs_get_notices', 'kbs_custom_frontend_notice' );

 


Was this article helpful?

We're working hard to ensure we provide you with useful and relevant documentation to help you get the most out of KB Support.

Please take a moment to let us know if you found this article helpful.

Advanced FAQs Hooks Customisation Last updated: 20/11/2017

Published by Cristian Raiber

Posts by Cristian Raiber

Post navigation

Previous

Allow Agents to Add and Edit Customers

Next

Email Support Email Commands

Contact Details

  • Follow us on Twitter
  • Like us on Facebook
  • Fork us on GitHub

Developer Resources

Plugin Boilerplate

Trello Board

GitHub Repository

Ratings & Satisfaction Docs

  • Configuring Ratings and Satisfaction
  • Advanced Settings

Email Support Docs

  • Plugin Requirements
  • Configuring Email Support
  • Creating New Tickets
  • Replying to Closed Tickets
  • Anonymous Replies in Email Support
  • HTML Emails Tags
  • Email Commands
  • Defining IMAP Flags

KBS REST API Docs

  • Using the REST API
  • Tickets REST API Route
  • Replies REST API Route
  • Articles REST API Route
  • Agents REST API Route
  • Customers REST API Route
  • Companies REST API Route
  • Forms REST API Route
  • Form Fields REST API Route
  • Ticket Categories REST API Route
  • Ticket Departments REST API Route
  • Ticket Source REST API Route

Article Categories

  • Configuration
    • Advanced
    • Getting Started
  • Developer Docs
    • Constants
    • Hooks
  • Extensions
  • FAQs
© 2023 KB Support. All rights reserved.
  • Blog
  • Shop
  • Support
  • Privacy Policy
  • Discount Code