A custom plugin developed to add colors and styles matching the legacy styles of a website produced in the 90’s. Retro!! Love it.
[cc lang=”php”] ‘description’ => __( ‘A basic text widget developed for the Celtein theme.’, ‘celteintextdomain’ )
)
);
load_plugin_textdomain( ‘celteintextdomain’, false, basename( dirname( __FILE__ ) ) . ‘/languages’ );
}
/**
* 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( ‘widget_title’, $instance[‘title’] );
$message = $instance[‘message’];
echo $before_widget . ‘
‘;
if ( $title ) {
echo $before_title . $title . $after_title;
}
echo ‘
‘ . ‘
‘;
echo $after_widget;
}
/**
* Sanitize widget form values as they are saved.
*
* @see WP_Widget::update()
*
* @param array $new_instance Values just sent to be saved.
* @param array $old_instance Previously saved values from database.
*
* @return array Updated safe values to be saved.
*/
public function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance[‘title’] = strip_tags( $new_instance[‘title’] );
$instance[‘message’] = ( $new_instance[‘message’] );
return $instance;
}
/**
* Back-end widget form.
*
* @see WP_Widget::form()
*
* @param array $instance Previously saved values from database.
*/
public function form( $instance ) {
$title = esc_attr( $instance[‘title’]);
$message = esc_attr($instance[‘message’]); ?>
}
}
/* Register the widget */
add_action( ‘widgets_init’, function(){
register_widget( ‘CelteinText_Widget’ );
});
[/cc]