<?php
/**
* Plugin Name: {{ NAMEOFPLUGIN }}
* Plugin URI: {{ PLUGGINURL }}
* Description: {{ WIDGETDESCRIPTION }}
* Version: {{ VERSION }}
* Author: {{ AUTOR }}
* Author URI: {{ PLUGGINURL }}
*/
add_action( 'widgets_init', '{{ BASENAME }}' );
function {{ BASENAME }}() {
register_widget( '{{ BASENAME }}' );
}
class {{ BASENAME }} extends WP_Widget {
function {{ BASENAME }}() {
$widget_ops = array(
'classname' => 'FearMe',
'description' => __('{{ WIDGETDESCRIPTION }}', 'FearMe')
);
$control_ops = array( 'width' => 250, 'height' => 350, 'id_base' => '{{ BASENAME }}' );
$this->WP_Widget( '{{ BASENAME }}', __('{{ NAMEOFPLUGIN }}', 'FearMe'), $widget_ops, $control_ops );
}
function widget( $args, $instance ) {
extract( $args );
${{ FIELD01 }} = apply_filters('widget_{{ FIELD01 }}', $instance['{{ FIELD01 }}'] );
${{ FIELD02 }} = apply_filters('widget_{{ FIELD02 }}', $instance['{{ FIELD02 }}'] );
${{ FIELD03 }} = apply_filters('widget_{{ FIELD03 }}', $instance['{{ FIELD03 }}'] );
${{ FIELD04 }} = apply_filters('widget_{{ FIELD04 }}', $instance['{{ FIELD04 }}'] );
${{ FIELD05 }} = apply_filters('widget_{{ FIELD05 }}', $instance['{{ FIELD05 }}'] );
${{ FIELD06 }} = apply_filters('widget_{{ FIELD06 }}', $instance['{{ FIELD06 }}'] );
${{ FIELD07 }} = apply_filters('widget_{{ FIELD07 }}', $instance['{{ FIELD07 }}'] );
${{ FIELD08 }} = apply_filters('widget_{{ FIELD08 }}', $instance['{{ FIELD08 }}'] );
${{ FIELD09 }} = apply_filters('widget_{{ FIELD09 }}', $instance['{{ FIELD09 }}'] );
${{ FIELD10 }} = apply_filters('widget_{{ FIELD10 }}', $instance['{{ FIELD10 }}'] );
if ( ${{ FIELD01 }} )
echo "<b>" . ${{ FIELD01 }} . "</b>";
if ( ${{ FIELD02 }} )
echo "<b>" . ${{ FIELD02 }} . "</b>";
if ( ${{ FIELD03 }} )
echo "<b>" . ${{ FIELD03 }} . "</b>";
if ( ${{ FIELD04 }} )
echo "<b>" . ${{ FIELD04 }} . "</b>";
if ( ${{ FIELD05 }} )
echo "<b>" . ${{ FIELD05 }} . "</b>";
if ( ${{ FIELD06 }} )
echo "<b>" . ${{ FIELD06 }} . "</b>";
if ( ${{ FIELD07 }} )
echo "<b>" . ${{ FIELD07 }} . "</b>";
if ( ${{ FIELD08 }} )
echo "<b>" . ${{ FIELD08 }} . "</b>";
if ( ${{ FIELD09 }} )
echo "<b>" . ${{ FIELD09 }} . "</b>";
if ( ${{ FIELD10 }} )
echo "<b>" . ${{ FIELD10 }} . "</b>";
}
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['{{ FIELD01 }}'] = strip_tags( $new_instance['{{ FIELD01 }}'] );
$instance['{{ FIELD02 }}'] = strip_tags( $new_instance['{{ FIELD02 }}'] );
$instance['{{ FIELD03 }}'] = strip_tags( $new_instance['{{ FIELD03 }}'] );
$instance['{{ FIELD04 }}'] = strip_tags( $new_instance['{{ FIELD04 }}'] );
$instance['{{ FIELD05 }}'] = strip_tags( $new_instance['{{ FIELD05 }}'] );
$instance['{{ FIELD06 }}'] = strip_tags( $new_instance['{{ FIELD06 }}'] );
$instance['{{ FIELD07 }}'] = strip_tags( $new_instance['{{ FIELD07 }}'] );
$instance['{{ FIELD08 }}'] = strip_tags( $new_instance['{{ FIELD08 }}'] );
$instance['{{ FIELD09 }}'] = strip_tags( $new_instance['{{ FIELD09 }}'] );
$instance['{{ FIELD010 }}'] = strip_tags( $new_instance['{{ FIELD010 }}'] );
return $instance;
}
function form( $instance ) {
$defaults = array(
'{{ FIELD01 }}' => __('{{ DEFAULT01 }}', 'FearMe'),
'{{ FIELD02 }}' => __('{{ DEFAULT02 }}', 'FearMe'),
'{{ FIELD03 }}' => __('{{ DEFAULT03 }}', 'FearMe'),
'{{ FIELD04 }}' => __('{{ DEFAULT04 }}', 'FearMe'),
'{{ FIELD05 }}' => __('{{ DEFAULT05 }}', 'FearMe'),
'{{ FIELD06 }}' => __('{{ DEFAULT06 }}', 'FearMe'),
'{{ FIELD07 }}' => __('{{ DEFAULT07 }}', 'FearMe'),
'{{ FIELD08 }}' => __('{{ DEFAULT08 }}', 'FearMe'),
'{{ FIELD09 }}' => __('{{ DEFAULT09 }}', 'FearMe'),
'{{ FIELD10 }}' => __('{{ DEFAULT10 }}', 'FearMe'),
);
$instance = wp_parse_args( (array) $instance, $defaults );
?>
<!-- Begin Back End Form -->
<style>
.moosetexter {
background-color : #fff;
border: 1px solid #ddd;
width: 230px;
}
</style>
<div style="background-color:#ccc;padding:10px;">
<h3>{{ NAMEOFPLUGIN }}</h3>
<!-- {{ DESCRIPTION01 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD01 }}'); ?>"><?php _e('{{ DESCRIPTION01 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD01 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD01 }}' ); ?>" value="<?php echo $instance['{{ FIELD01 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION02 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD02 }}'); ?>"><?php _e('{{ DESCRIPTION02 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD02 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD02 }}' ); ?>" value="<?php echo $instance['{{ FIELD02 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION03 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD03 }}'); ?>"><?php _e('{{ DESCRIPTION03 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD03 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD03 }}' ); ?>" value="<?php echo $instance['{{ FIELD03 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION04 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD04 }}'); ?>"><?php _e('{{ DESCRIPTION04 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD04 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD04 }}' ); ?>" value="<?php echo $instance['{{ FIELD04 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION05 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD05 }}'); ?>"><?php _e('{{ DESCRIPTION05 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD05 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD05 }}' ); ?>" value="<?php echo $instance['{{ FIELD05 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION06 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD06 }}'); ?>"><?php _e('{{ DESCRIPTION06 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD06 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD06 }}' ); ?>" value="<?php echo $instance['{{ FIELD06 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION07 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD07 }}'); ?>"><?php _e('{{ DESCRIPTION07 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD07 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD07 }}' ); ?>" value="<?php echo $instance['{{ FIELD07 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION08 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD08 }}'); ?>"><?php _e('{{ DESCRIPTION08 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD08 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD08 }}' ); ?>" value="<?php echo $instance['{{ FIELD08 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION09 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD09 }}'); ?>"><?php _e('{{ DESCRIPTION09 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD09 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD09 }}' ); ?>" value="<?php echo $instance['{{ FIELD09 }}']; ?>" style="width:100%;" /></p>
<!-- {{ DESCRIPTION10 }} -->
<p><label for="<?php echo $this->get_field_id( '{{ FIELD10 }}'); ?>"><?php _e('{{ DESCRIPTION10 }}:', 'hybrid'); ?></label>
<input class="moosetexter" id="<?php echo $this->get_field_id( '{{ FIELD10 }}' ); ?>" name="<?php echo $this->get_field_name( '{{ FIELD10 }}' ); ?>" value="<?php echo $instance['{{ FIELD10 }}']; ?>" style="width:100%;" /></p>
<!-- End Back End Form -->
</div>
<?php
}
}
?>