<?php namespace WoWPress\Frontend\Widgets; class RaidSignup extends Widget { protected $template_path = "raid_signup.php"; protected $title = "Raid-Anmeldungen"; protected $base_id = "wowpress_raid_signup"; public $name = "Raidanmeldungen"; protected $restricted = "wowpress_view_raids"; public function form( $instance ) { $count = ! empty( $instance['count'] ) ? $instance['count'] : 1; ?> <p> <label for="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>"><?php echo esc_html__( 'Anzahl', 'wowpress' ); ?></label> <input class="widefat" id="<?php echo esc_attr( $this->get_field_id( 'count' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'count' ) ); ?>" min="1" max="5" type="number" value="<?php echo esc_attr( $count ); ?>"> </p> <?php } public function update( $new_instance, $old_instance ) { $instance = array(); $instance['count'] = ( ! empty( $new_instance['count'] ) ) ? strip_tags( $new_instance['count'] ) : ''; return $instance; } }