'WP_Editor_Widget', 'description' => __( 'Arbitrary text, HTML or rich text through the standard WordPress visual editor.', 'wp-editor-widget' ), ) ); parent::__construct( 'WP_Editor_Widget', __( 'Rich text', 'wp-editor-widget' ), $widget_ops ); } // END __construct() /** * Front-end display of widget. * * @see WP_Widget::widget() * * @param array $args Widget arguments. * @param array $instance Saved values from database. */ public function widget( $args, $instance ) { extract( $args ); $title = apply_filters( 'wp_editor_widget_title', $instance['title'] ); $output_title = apply_filters( 'wp_editor_widget_output_title', $instance['output_title'] ); $content = apply_filters( 'wp_editor_widget_content', $instance['content'] ); echo $before_widget; if ( $output_title == "1" && !empty($title) ) { echo $before_title . $title . $after_title; } echo $content; echo $after_widget; } // END widget() /** * Back-end widget form. * * @see WP_Widget::form() * * @param array $instance Previously saved values from database. */ public function form( $instance ) { if ( isset($instance['title']) ) { $title = $instance['title']; } else { $title = __( 'New title', 'wp-editor-widget' ); } if ( isset($instance['content']) ) { $content = $instance['content']; } else { $content = ""; } $output_title = ( isset($instance['output_title']) && $instance['output_title'] == "1" ? true : false ); ?>