09-17-2011, 09:26 PM
|
|
|
Confirmed User
Join Date: Mar 2004
Posts: 626
|
where do i put this? can someone tell me?
Quote:
Originally Posted by fris
this should do it
Code:
<?php
class PlugRush_Widget extends WP_Widget
{
public function __construct()
{
$widgetname = apply_filters( 'plugrush_widget', 'PlugRush Widget' );
parent::__construct(
'unfiltered_text'
, $widgetname
, array( 'description' => 'Plug Rush Iframe Text Widget' )
, array( 'width' => 300, 'height' => 150 )
);
}
public function widget( $args, $instance )
{
echo $instance['text'];
}
public function update( $new_instance, $old_instance )
{
return $new_instance;
}
public function form( $instance )
{
$instance = wp_parse_args( (array) $instance, array( 'text' => '' ) );
$text = format_to_edit($instance['text']);
?>
<textarea class="widefat" rows="7" cols="20" id="<?php
echo $this->get_field_id( 'text' );
?>" name="<?php
echo $this->get_field_name( 'text' );
?>"><?php
echo $text;
?></textarea>
<?php
}
}
add_action( 'widgets_init', 'register_unfiltered_text_widget', 20 );
function register_unfiltered_text_widget()
{
register_widget( 'PlugRush_Widget' );
}
|
|
|
|