View Single Post
Old 09-16-2011, 01:02 PM  
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,378
Quote:
Originally Posted by esham View Post
Im trying to add the widget but its not working. Does anyone use plugrush on wordpress. If so what plugins do I need. I got it to show on pages by adding [ And ] to end of html. How can i get it to show in sidebar?
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' );
}
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote