Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions classes/widget.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ public function update( $new_instance, $old_instance ) {

$instance['styles_default'] = isset( $new_instance['styles_default'] ) ? (bool) $new_instance['styles_default'] : false;
$instance['cssID'] = sanitize_html_class( $new_instance['cssID'] );
$instance['markupType'] = sanitize_html_class( $new_instance['markupType'] );
$instance['css_class'] = sanitize_html_class( $new_instance['css_class'] );
$instance['css'] = $new_instance['css'];

Expand Down
10 changes: 9 additions & 1 deletion includes/form.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Widget forms.
*
* @package Recent_Posts_Widget_Extended
* @since 0.9.4
* @since 0.9.9.7
* @author Satrya
* @copyright Copyright (c) 2014, Satrya
* @license http://www.gnu.org/licenses/gpl-2.0.html
Expand All @@ -27,6 +27,14 @@
</p>

<p>
<label for="<?php echo $this->get_field_id( 'markupType' ); ?>">
<?php _e( 'Markup Type (ex: div, h3, h4)', 'recent-posts-widget-extended' ); ?>
</label>
<input class="widefat" id="<?php echo $this->get_field_id( 'markupType' ); ?>" name="<?php echo $this->get_field_name( 'markupType' ); ?>" type="text" value="<?php if(empty($instance['markupType'])) { echo 'h3'; } else { echo sanitize_html_class( $instance['markupType'] ); } ?>"/>
</p>


<p>
<label for="<?php echo $this->get_field_id( 'cssID' ); ?>">
<?php _e( 'CSS ID', 'recent-posts-widget-extended' ); ?>
</label>
Expand Down
7 changes: 5 additions & 2 deletions includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Various functions used by the plugin.
*
* @package Recent_Posts_Widget_Extended
* @since 0.9.4
* @since 0.9.9.7
* @author Satrya
* @copyright Copyright (c) 2014, Satrya
* @license http://www.gnu.org/licenses/gpl-2.0.html
Expand Down Expand Up @@ -50,6 +50,7 @@ function rpwe_get_default_args() {

'styles_default' => true,
'css' => $css_defaults,
'markupType' => '',
'cssID' => '',
'css_class' => '',
'before' => '',
Expand Down Expand Up @@ -167,7 +168,9 @@ function rpwe_get_recent_posts( $args = array() ) {

endif;

$html .= '<h3 class="rpwe-title"><a href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'recent-posts-widget-extended' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark">' . esc_attr( get_the_title() ) . '</a></h3>';
if(empty($args['markupType'])) { $markupType = 'div'; } else { $markupType = $args['markupType']; }

$html .= '<' . $markupType . ' class="rpwe-title"><a href="' . esc_url( get_permalink() ) . '" title="' . sprintf( esc_attr__( 'Permalink to %s', 'recent-posts-widget-extended' ), the_title_attribute( 'echo=0' ) ) . '" rel="bookmark">' . esc_attr( get_the_title() ) . '</a></' . $markupType . '>';

if ( $args['date'] ) :
$date = get_the_date();
Expand Down
4 changes: 2 additions & 2 deletions rpwe.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: Recent Posts Widget Extended
* Plugin URI: https://www.theme-junkie.com/plugins/recent-posts-widget-extended/
* Description: Enables advanced widget that gives you total control over the output of your site’s most recent Posts.
* Version: 0.9.9.6
* Version: 0.9.9.7
* Author: Satrya
* Author URI: https://www.theme-junkie.com/
* Author Email: support@theme-junkie.com
Expand Down Expand Up @@ -135,4 +135,4 @@ function register_image_size() {

}

new RPW_Extended;
new RPW_Extended;