google-language-translator
Last commit date
css
12 years ago
images
12 years ago
admin.js
12 years ago
flags.js
12 years ago
google-language-translator.php
12 years ago
readme.txt
12 years ago
widget.php
12 years ago
widget.php
25 lines
| 1 | <?php |
| 2 | |
| 3 | add_action( 'widgets_init', create_function( '', 'register_widget( "Google_Language_Translator" );' ) ); |
| 4 | |
| 5 | class Google_Language_Translator extends WP_Widget { |
| 6 | |
| 7 | public function __construct() { |
| 8 | parent::__construct( |
| 9 | 'bapi_google_translate', // Base ID |
| 10 | 'Google Language Translator', // Name |
| 11 | array( 'description' => __( 'Go to Settings > Google Language Translator to configure this widget.', 'text_domain' ), ) // Args |
| 12 | ); |
| 13 | } |
| 14 | |
| 15 | public function widget( $args, $instance ) { |
| 16 | extract( $args ); |
| 17 | $title = apply_filters( 'widget_title', $instance['title'] ); |
| 18 | |
| 19 | echo $before_widget; |
| 20 | echo google_translator_shortcode(); |
| 21 | echo $after_widget; |
| 22 | } |
| 23 | |
| 24 | } // class Google_Translate_Widget |
| 25 | ?> |