diff --git a/classes/widget.php b/classes/widget.php index 5208b6e..63e5462 100644 --- a/classes/widget.php +++ b/classes/widget.php @@ -21,12 +21,12 @@ function __construct() { $widget_options = array( 'classname' => 'arpw-widget-random', 'description' => __( 'An advanced widget that gives you total control over the output of the random posts.', 'arpw' ) - ); + ); $control_ops = array( 'width' => 700, 'height' => 350, - ); + ); // Create the widget. $this->WP_Widget( @@ -34,7 +34,7 @@ function __construct() { __( 'Random Posts', 'arpw' ), // $this->name $widget_options, // $this->widget_options $control_ops // $this->control_options - ); + ); } @@ -94,6 +94,8 @@ function update( $new_instance, $old_instance ) { $instance['thumbnail_width'] = (int) $new_instance['thumbnail_width']; $instance['thumbnail_height'] = (int) $new_instance['thumbnail_height']; + $instance['content'] = isset( $new_instance['content'] ) ? (bool) $new_instance['content'] : false; + $instance['excerpt'] = isset( $new_instance['excerpt'] ) ? (bool) $new_instance['excerpt'] : false; $instance['excerpt_length'] = (int) $new_instance['excerpt_length']; $instance['date'] = isset( $new_instance['date'] ) ? (bool) $new_instance['date'] : false; diff --git a/includes/form.php b/includes/form.php index 1813bcb..ba274ba 100644 --- a/includes/form.php +++ b/includes/form.php @@ -191,6 +191,13 @@ +

+ id="get_field_id( 'content' ); ?>" name="get_field_name( 'content' ); ?>" /> + +

+

id="get_field_id( 'excerpt' ); ?>" name="get_field_name( 'excerpt' ); ?>" />

' . wp_trim_words( apply_filters( 'arpw_excerpt', get_the_excerpt() ), $args['excerpt_length'], ' …' ) . '
'; endif; + if ( $args['content'] ) : + $html .= '
' . apply_filters( 'arpw_content', get_the_content() ) . '
'; + endif; + $html .= ''; endwhile;