How to change button text?
-
Text to speech TTS plugin gives users to change the button text according to users’ locale language.
Here’s a step-by-step guide to using filters for customizing button text:
- Install the “Code Snippets” Plugin: To leverage filters, you’ll need to install the Code Snippets plugin. This plugin allows you to add custom code snippets to your WordPress site.
- Create a New Snippet: After installing the Code Snippets plugin, navigate to “Snippets” and select “Add New” to create a new snippet.
- Add the Filter Code: Copy and paste the following code block into your snippet:
add_filter( 'tta__button_text_arr', 'tta__button_text_arr_callback'); function tta__button_text_arr_callback( $text_arr ){ // Listen button $text_arr['listen_text'] = 'Listen'; // paste custem text $text_arr['pause_text'] = 'Pause'; // paste custem text $text_arr['resume_text'] = 'Resume'; // paste custem text $text_arr['replay_text'] = 'Replay'; // paste custem text // Record button text $text_arr['start_text'] = 'Start'; // paste custem text $text_arr['stop_text'] = 'Stop'; // paste custem text return $text_arr; }
Save and Activate:?Save the snippet and activate it.
- The topic ‘How to change button text?’ is closed to new replies.