Changeset 2558574
- Timestamp:
- 07/05/2021 07:43:27 AM (5 years ago)
- Location:
- responsivevoice-text-to-speech/trunk
- Files:
-
- 2 edited
-
readme.txt (modified) (3 diffs)
-
responsivevoice-text-to-speech.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
responsivevoice-text-to-speech/trunk/readme.txt
r2507842 r2558574 6 6 Requires at least: 3.6 7 7 Tested up to: 5.7 8 Stable tag: 1. 6.98 Stable tag: 1.7.0 9 9 License: GPLv2 10 10 … … 80 80 81 81 == Changelog == 82 83 = Version 1.7.0 = 84 * Add `responsivevoice_content_before_cleaning` and `responsivevoice_content_after_cleaning` filter hooks for plugin and theme developers. 82 85 83 86 = Version 1.6.9 = … … 284 287 == Upgrade Notice == 285 288 286 = 1. 6.8=289 = 1.7.0 = 287 290 * Upgrade the plugin for the latest improvements. -
responsivevoice-text-to-speech/trunk/responsivevoice-text-to-speech.php
r2507842 r2558574 4 4 Plugin URI: responsivevoice.com/wordpress-text-to-speech-plugin/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=wprvttsplugin 5 5 Description: An easy to use plugin to integrate ResponsiveVoice Text to Speech into your WP blog. 6 Version: 1. 6.96 Version: 1.7.0 7 7 Author: ResponsiveVoice 8 8 Author URI: http://responsivevoice.com … … 28 28 add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'RV_custom_plugin_action_links'); 29 29 30 /** 31 * Adds a "Listen" button to the post that reads its entire contents. 32 * 33 * @param array $attributes 34 * 35 * @return string 36 */ 30 37 function RV_add_listen_button($attributes) 31 38 { … … 33 40 $id_listenButton++; 34 41 35 $postContent = get_the_content(); 36 $postContent = RV_clean_text($postContent); 42 $content = get_the_content(); 43 $content = apply_filters('responsivevoice_content_before_cleaning', $content); 44 $content = RV_clean_text($content); 45 $content = apply_filters('responsivevoice_content_after_cleaning', $content); 46 /** 47 * @var string $voice 48 * @var string $buttontext 49 */ 37 50 extract(shortcode_atts(array( 38 51 'voice' => 'UK English Female', … … 50 63 responsiveVoice.cancel(); 51 64 }else{ 52 responsiveVoice.speak("' . $ postContent . '", "' . $voice . '"' . $parameters . ');65 responsiveVoice.speak("' . $content . '", "' . $voice . '"' . $parameters . '); 53 66 } 54 67 }; … … 59 72 } 60 73 74 /** 75 * Adds a BB-style button to the post that reads the content enclosed within the opening and closing shortcodes. 76 * 77 * @param array $attributes 78 * @param string $includedtext 79 * 80 * @return string 81 */ 61 82 function RV_add_bblisten($attributes, $includedtext = "") 62 83 { … … 64 85 $id_bb++; 65 86 66 $cleantext = RV_clean_text($includedtext); 87 $content = apply_filters('responsivevoice_content_before_cleaning', $includedtext); 88 $content = RV_clean_text($content); 89 $content = apply_filters('responsivevoice_content_after_cleaning', $content); 90 /** 91 * @var string $voice 92 * @var string $buttontext 93 * @var string $buttonposition 94 */ 67 95 extract(shortcode_atts(array( 68 96 'voice' => 'UK English Female', … … 81 109 responsiveVoice.cancel(); 82 110 }else{ 83 responsiveVoice.speak("' . $c leantext . '", "' . $voice . '"' . $parameters . ');111 responsiveVoice.speak("' . $content . '", "' . $voice . '"' . $parameters . '); 84 112 } 85 113 }; … … 87 115 '; 88 116 89 if ($buttonposition == 'after') { 90 return $includedtext . $bb; 91 } else { 92 return $bb . $includedtext; 93 } 117 return $buttonposition === 'after' ? $includedtext . $bb : $bb . $includedtext; 94 118 } 95 119 … … 121 145 } 122 146 123 foreach ($attributes AS$attribute => $value) {147 foreach ($attributes as $attribute => $value) { 124 148 if (array_search($attribute, $valid_attributes) === false) { 125 149 unset($attributes[$attribute]);
Note: See TracChangeset
for help on using the changeset viewer.