fields = array( 'title', 'max_shows' ); $this->checkboxes = array( 'age_limit', 'artist_name', 'country', 'show_name', 'venue_stage', 'show_time', 'ticket_info' ); $this->layouts = array( 'Classic', 'iCal' ); // Future i10n support // load_plugin_textdomain( PLUGIN_LOCALE, false, dirname( plugin_basename( __FILE__ ) ) . '/lang/' ); } //End of artistdatapress_widget function /** * Back-end widget form. * * @see WP_Widget::form() * * @uses wp_parse_args * @uses esc_attr * @uses get_field_id * @uses get_field_name * @uses checked * * @param array $instance Previously saved values from database. */ function form( $instance ) { $defaults['title'] = 'ArtistDataPress'; $defaults['max_shows'] = ''; $defaults['layout'] = 'Classic'; foreach ( $this->checkboxes as $checkbox ) { $defaults[$checkbox] = 0; } // End of $checkboxes foreach $instance = wp_parse_args( (array) $instance, $defaults ); foreach ( $this->fields as $field ) { $label = ucwords( str_replace( '_', ' ', $field ) ); echo '
'; <<<<<<< .mine } // End of $fields foreach echo ''; echo '
'; foreach ( $this->checkboxes as $checkbox ) { $check = ( isset( $instance[$checkbox] ) ? (bool) $instance[$checkbox] : false ); $words = str_replace( '_', ' ', $checkbox ); echo '';
echo ( $checkbox == 'artist_name' ? '
' . __( '*Requires "Display show name" also' ) . '' : '' );
echo '