Skip to content

Commit

Permalink
Use wp_parse_args for widget defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeshev committed Oct 15, 2013
1 parent 1f4e318 commit 39ad060
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/dx-sample-widget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function form ( $instance ) {
'sample_dropdown' => '',
);

$instance = array_merge( $instance, $instance_defaults );
$instance = wp_parse_args( $instance, $instance_defaults );

$title = esc_attr( $instance[ 'title' ] );
$sample_text = esc_attr( $instance[ 'sample_text' ] );
Expand All @@ -105,4 +105,4 @@ public function form ( $instance ) {
}

// Register the widget for use
register_widget('DX_Sample_Widget');
register_widget('DX_Sample_Widget');

0 comments on commit 39ad060

Please sign in to comment.