';
foreach ( $fields as $field ) {
$item_html = self::presscore_render_accordion_item( $field );
if ( $item_html ) {
echo '
' . $item_html . '
';
}
}
echo '
';
}
echo $after_widget;
}
/* Update the widget settings */
function update( $new_instance, $old_instance ) {
$instance = $old_instance;
$instance['title'] = strip_tags($new_instance['title']);
$instance['fields'] = $this->presscore_validate_fields( $new_instance['fields'] );
return $instance;
}
/**
* Displays the widget settings controls on the widget panel.
* Make use of the get_field_id() and get_field_name() function
* when creating your form elements. This handles the confusing stuff.
*/
function form( $instance ) {
/* Set up some default widget settings. */
$instance = wp_parse_args( (array) $instance, self::$widget_defaults );
$fields = empty( $instance['fields'] ) ? array() : $instance['fields'];
?>