Van Goghs Favorites IV: Paul Renouard, the Zola of Drawing Alexander Roob “There is life in every little pencil stroke.” Letter from Vincent van Gogh to Theo van Gogh Nuenen, 4 or 5 May 1885 “When I think how he ro...
Read More →/*
Plugin Name: Multilingue
Plugin URI: https://wordpress.org/plugins/multilingue/
Description: Translate your website in one click !
Version: 1.0
Author: Bastien Canas
Author URI: http://bastiencanas.fr/
*/
class myWidget {
function myWidget() {
add_action('widgets_init', array(& $this, 'init_widget'));
}
function init_widget() {
if ( !function_exists('register_sidebar_widget') || !function_exists('register_widget_control') )
return;
register_sidebar_widget(array('Multilingue','widgets'),array(& $this, 'widget'));
register_widget_control(array('Multilingue', 'widgets'), array(& $this, 'widget_options'));
}
function widget($args) {
global $wpdb;
$WidgetTitle=get_option('mywidget_options');
extract($args);
echo $before_widget.$before_title.$WidgetTitle.$after_title;
$Langue = explode(',',$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Langue = strtolower(substr(chop($Langue[0]),0,2));
?>
echo $after_widget;
}
function widget_options() {
if ($_POST['mywidget_options']) {
$option=$_POST['mywidget_options'];
update_option('mywidget_options',$option);
}
$option=get_option('mywidget_options');
echo '';
}
}
$myWidgetVariable= new myWidget ();
?>
Van Goghs Favorites IV: Paul Renouard, the Zola of Drawing Alexander Roob “There is life in every little pencil stroke.” Letter from Vincent van Gogh to Theo van Gogh Nuenen, 4 or 5 May 1885 “When I think how he ro...
Read More →