| Server IP : 10.19.1.101 / Your IP : 216.73.216.158 Web Server : Apache System : Linux web1f13.kinghost.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64 User : schererimoveisrs ( 170628) PHP Version : 7.4.33 Disable Function : apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /home/schererimoveisrs/www/pre backup/wp-content/themes/sauron/inc/widgets/ |
Upload File : |
<?php
class sauron_adsens extends WP_Widget
{
function __construct(){
$widget_ops = array('description' => __('Displays Adsense', "sauron"));
$control_ops = array('width' => 400, 'height' => 500);
parent::__construct(false,$name='Adsense',$widget_ops,$control_ops);
}
/* Displays the Widget in the front-end */
function widget($args, $instance){
extract($args);
$title = esc_html( $instance['title']);
$adsenseCode = empty( $instance['adsenseCode'] ) ? '' : $instance['adsenseCode'];
echo $before_widget;
if ( $title )
echo $before_title . $title . $after_title;
?>
<div style="overflow: hidden;">
<?php echo $adsenseCode; ?>
</div>
<?php
echo $after_widget;
}
/*Saves the settings. */
function update($new_instance, $old_instance){
$instance = $old_instance;
$instance['title'] = sanitize_text_field( $new_instance['title'] );
$instance['adsenseCode'] = wp_filter_post_kses( addslashes($new_instance['adsenseCode']));
return $instance;
}
/*Creates the form for the widget in the back-end. */
function form($instance){
//Defaults
$instance = wp_parse_args( (array) $instance, array( 'title'=>'Adsense', 'adsenseCode'=>'' ) );
$title = esc_attr( $instance['title'] );
$adsenseCode = esc_textarea( $instance['adsenseCode'] );
echo '<p><label for="' . $this->get_field_id('title') . '">' . __('Title:', "sauron") . '</label><input class="widefat" id="' . $this->get_field_id('title') . '" name="' . $this->get_field_name('title') . '" type="text" value="' . $title . '" /></p>';
echo '<p><label for="' . $this->get_field_id('adsenseCode') . '">' . __('Adsense Code:', "sauron") . '</label><textarea cols="20" rows="12" class="widefat" id="' . $this->get_field_id('adsenseCode') . '" name="' . $this->get_field_name('adsenseCode') . '" >'. $adsenseCode .'</textarea></p>';
}
}// end sauron_adv class
add_action('widgets_init', create_function('', 'return register_widget("sauron_adsens");'))
?>