This quick tutorial explains how to customize the various form elements for SAC Pro. By default, each chat form includes form fields with labels like “Name”, “URL”, “Message”, “Submit”, and so forth. The plugin does not provide options to change these default labels, but it is possible to customize by adding a bit of custom code to your WordPress site. Very quick and easy..
Name Field
To change the label used by the “Name” field, add the following code:
function sacpro_name_label($label) {
return 'Name'; // change to whatever
}
add_filter('sacpro_name_label', 'sacpro_name_label');
The only change that needs made is the Name
text. Change that to whatever you would like to display for the “Name” field and done.
URL Field
To change the label used by the “URL” field, add the following code:
function sacpro_url_label($label) {
return 'URL'; // change to whatever
}
add_filter('sacpro_url_label', 'sacpro_url_label');
The only change that needs made is the URL
text. Change that to whatever you would like to display for the “URL” field and done.
Message Field
To change the label used by the “Message” field, add the following code:
function sacpro_text_label($label) {
return 'Message'; // change to whatever
}
add_filter('sacpro_text_label', 'sacpro_text_label');
The only change that needs made is the Message
text. Change that to whatever you would like to display for the “Message” field and done.
Submit Button
To change the label used by the “Submit” button, add the following code:
function sacpro_submit_button($label) {
return 'Submit'; // change to whatever
}
add_filter('sacpro_submit_button', 'sacpro_submit_button');
The only change that needs made is the Submit
text. Change that to whatever you would like to display for the “Submit” field and done.
Latest Message
To change the label used by the “Latest Message” text, add the following code:
function sacpro_latest_message($output, $table_name, $num_rows, $latest, $time) {
return 'Latest Message'; // change to whatever
}
add_filter('sacpro_latest_message', 'sacpro_latest_message', 10, 5);
The only change that needs made is the Latest Message
text. Change that to whatever you would like to display for the “Latest Message” text and done.