PluginProbe
GSpeech TTS – WordPress Text To Speech Plugin / 3.21.0
GSpeech TTS – WordPress Text To Speech Plugin v3.21.0
3.21.5 3.21.4 3.21.3 3.21.1 3.21.2 3.20.8 3.21.0 3.20.7 3.20.6 3.20.4 3.20.5 3.20.3 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 3.10.0 3.10.1 3.10.2 3.10.3 3.11.0 3.11.1 3.11.2 3.12.0 All 161 releases
gspeech / includes / gspeech_widget.php

gspeech_widget.php in GSpeech TTS – WordPress Text To Speech Plugin 3.21.0, at includes/gspeech_widget.php

43 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 // no direct access!
3 defined('ABSPATH') or die("No direct access");
4
5 class GSpeechWidget extends WP_Widget {
6
7 function __construct() {
8
9 parent::__construct('gspeech', esc_html__('GSpeech', 'gspeech'), array('description' => esc_html__('GSpeech - Text To Speech', 'gspeech')));
10 }
11
12 public function widget($args, $instance) {
13
14 echo $args['before_widget'];
15
16 if(!empty($instance['title'])) {
17 echo $args['before_title'] . apply_filters('widget_title', $instance['title']) . $args['after_title'];
18 }
19
20 echo GSpeech::get_widget_code(array('position' => 'inline', 'wrapper_selector' => '.gtranslate_wrapper'));
21
22 echo $args['after_widget'];
23 }
24
25 public function form($instance) {
26
27 $title = !empty($instance['title']) ? $instance['title'] : '';
28 ?>
29 <p>
30 <label for="<?php echo esc_attr($this->get_field_id('title')); ?>"><?php esc_attr_e('Title:', 'gspeech'); ?></label>
31 <input class="widefat" id="<?php echo esc_attr($this->get_field_id('title')); ?>" name="<?php echo esc_attr($this->get_field_name('title')); ?>" type="text" value="<?php echo esc_attr($title); ?>">
32 </p>
33 <?php
34 }
35
36 public function update($new_instance, $old_instance) {
37
38 $instance = array();
39 $instance['title'] = (!empty($new_instance['title'])) ? strip_tags($new_instance['title']) : '';
40
41 return $instance;
42 }
43 }