';
} else {
if ( isset( $val ) && isset( $instance[ 'inline_style' ] ) ) {
$style = str_replace( PHP_EOL, '', $instance[ 'inline_style' ] );
$style = wp_strip_all_tags( $style );
echo '
';
}
}
if ( isset( $instance[ 'inline_style' ] ) && ( $instance[ 'content' ] == 'content' || $instance[ 'content' ] == 'excerpt' ) && !is_single( $val ) ) {
$posts = get_posts( array( 'include' => absint( $val ), 'post_type' => sanitize_key( $instance[ 'type' ] ) ) );
$pinup_entry_title_class = apply_filters( 'raindrops_pinup_entry_title_class', ' title pinup-entry-title ' );
$pinup_entry_title_class = trim( $pinup_entry_title_class );
$html_title = '
';
foreach ( $posts as $post ) {
setup_postdata( $post );
printf( $html_title, absint( $post->ID ), esc_url( get_permalink( $post->ID ) ), get_the_title( $post->ID ) );
if ( isset( $instance[ 'content' ] ) and $instance[ 'content' ] == 'excerpt' ) {
the_excerpt();
} else {
if ( isset( $post->post_content ) && !empty( $post->post_content ) ) {
$raindrops_pinup_content = $post->post_content;
if ( preg_match( '//u', $raindrops_pinup_content, $matches ) ) {
list( $raindrops_pinup_content, $raindrops_pinup_sub_content ) = explode( $matches[ 0 ], $raindrops_pinup_content, 2 );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
} elseif ( preg_match( '//u', $raindrops_pinup_content, $matches ) ) {
list( $raindrops_pinup_content, $raindrops_pinup_sub_content ) = explode( $matches[ 0 ], $raindrops_pinup_content, 2 );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
} else {
$raindrops_pinup_content = get_post( absint( $post->ID ) );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content->post_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
}
}
}
}
wp_reset_postdata();
}
if ( isset( $instance[ 'inline_style' ] ) && $instance[ 'content' ] == 'attachment' && !is_single( $val ) ) {
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => 'public',
'post_parent' => $val
);
$attachments = get_posts( $args );
$attachments_num = count( $attachments );
if ( isset( $attachments ) && $attachments_num > 1 ) {
$attachment_key = rand( 0, $attachments_num - 1 );
$post = $attachments[ $attachment_key ];
} elseif ( $attachments_num == 1 ) {
$post = $attachments[ 0 ];
} else {
}
if ( isset( $attachments ) && $attachments_num > 0 ) {
setup_postdata( $post );
$raindrops_image_size = 'midium';
if ( raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ) > 25 ) {
$raindrops_image_size = 'large';
}
$html = '
%2$s';
$check_alt_exists = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
if ( !empty( $check_alt_exists ) ) {
$alt_attribute = esc_attr( $check_alt_exists );
} else {
$alt_attribute = wp_kses( get_the_title( $val ), array() );
}
$attr = array(
'alt' => trim( $alt_attribute ),
);
printf( $html, get_permalink( $val ), wp_get_attachment_image( $post->ID, apply_filters( 'raindrops_pinup_image_size', $raindrops_image_size, get_the_ID() ), false, $attr ) );
$html = '
%1$s
';
printf( $html, get_the_title( $val ), absint( $val ) );
wp_reset_postdata();
}
}
if ( isset( $instance[ 'inline_style' ] ) && $instance[ 'content' ] == 'featured' && !is_single( $val ) ) {
if ( has_post_thumbnail( $val ) ) {
$html = '
%2$s';
$raindrops_image_size = 'midium';
if ( raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ) > 25 ) {
$raindrops_image_size = 'large';
}
$alt_attribute = wp_kses( get_the_title( $val ), array() );
$attr = array(
'alt' => trim( $alt_attribute ),
);
printf( $html, esc_url( get_permalink( $val ) ), get_the_post_thumbnail( $val, apply_filters( 'raindrops_pinup_image_size', $raindrops_image_size, get_the_ID() ) ), $attr );
$html = '
%1$s
';
printf( $html, get_the_title( $val ), absint( $val ) );
} else {
$html = '
';
printf( $html, get_the_title( $val ), absint( $val ), esc_url( get_permalink( $val ) ) );
}
}
if ( isset( $val ) ) {
echo '
';
}
echo $after_widget;
echo '';
}
echo '';
} else {
/**
* Show Randum
*/
if ( isset( $instance[ 'id' ] ) && preg_match( '!,!', $instance[ 'id' ] ) ) {
$content_id = explode( ',', $instance[ 'id' ] );
$count = count( $content_id );
$num = rand( 0, $count - 1 );
$content_id = $content_id[ $num ];
} elseif( isset( $instance[ 'id' ] ) ) {
$content_id = absint( $instance[ 'id' ] );
}
if ( isset( $content_id ) && isset( $instance[ 'inline_style' ] ) && !empty( $instance[ 'inline_style' ] ) ) {
$style = str_replace( PHP_EOL, '', $instance[ 'inline_style' ] );
$style = wp_strip_all_tags( $style );
echo '
';
} else {
if ( isset( $content_id ) && isset( $instance[ 'inline_style' ] ) ) {
$style = str_replace( PHP_EOL, '', $instance[ 'inline_style' ] );
$style = wp_strip_all_tags( $style );
echo '
';
}
}
if ( isset( $instance[ 'inline_style' ] ) && ( $instance[ 'content' ] == 'content' || $instance[ 'content' ] == 'excerpt' ) && !is_single( $content_id ) ) {
$posts = get_posts( array( 'include' => absint( $content_id ), 'post_type' => sanitize_key( $instance[ 'type' ] ) ) );
$pinup_entry_title_class = apply_filters( 'raindrops_pinup_entry_title_class', ' title pinup-entry-title ' );
$pinup_entry_title_class = trim( $pinup_entry_title_class );
$html_title = '
';
foreach ( $posts as $post ) {
setup_postdata( $post );
printf( $html_title, absint( $post->ID ), esc_url( get_permalink( $post->ID ) ), get_the_title( $post->ID ) );
if ( isset( $instance[ 'content' ] ) and $instance[ 'content' ] == 'excerpt' ) {
the_excerpt();
} else {
if ( isset( $post->post_content ) && !empty( $post->post_content ) ) {
$raindrops_pinup_content = $post->post_content;
if ( preg_match( '//u', $raindrops_pinup_content, $matches ) ) {
list( $raindrops_pinup_content, $raindrops_pinup_sub_content ) = explode( $matches[ 0 ], $raindrops_pinup_content, 2 );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
} elseif ( preg_match( '//u', $raindrops_pinup_content, $matches ) ) {
list( $raindrops_pinup_content, $raindrops_pinup_sub_content ) = explode( $matches[ 0 ], $raindrops_pinup_content, 2 );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
} else {
$raindrops_pinup_content = get_post( absint( $post->ID ) );
$raindrops_pinup_content = apply_filters( 'the_content', $raindrops_pinup_content->post_content );
$raindrops_pinup_content = apply_filters( 'raindrops_entry_content', $raindrops_pinup_content );
$raindrops_pinup_content = str_replace( ']]>', ']]>', $raindrops_pinup_content );
echo $raindrops_pinup_content;
}
}
}
}
wp_reset_postdata();
}
if ( isset( $instance[ 'inline_style' ] ) && $instance[ 'content' ] == 'attachment' && !is_single( $content_id ) ) {
$args = array(
'post_type' => 'attachment',
'numberposts' => -1,
'post_status' => 'public',
'post_parent' => $content_id
);
$attachments = get_posts( $args );
$attachments_num = count( $attachments );
if ( isset( $attachments ) && $attachments_num > 1 ) {
$attachment_key = rand( 0, $attachments_num - 1 );
$post = $attachments[ $attachment_key ];
} elseif ( $attachments_num == 1 ) {
$post = $attachments[ 0 ];
} else {
}
if ( isset( $attachments ) && $attachments_num > 0 ) {
setup_postdata( $post );
$raindrops_image_size = 'midium';
if ( raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ) > 25 ) {
$raindrops_image_size = 'large';
}
$html = '
%2$s';
$check_alt_exists = get_post_meta( $post->ID, '_wp_attachment_image_alt', true );
if ( !empty( $check_alt_exists ) ) {
$alt_attribute = esc_attr( $check_alt_exists );
} else {
$alt_attribute = wp_kses( get_the_title( $content_id ), array() );
}
$attr = array(
'alt' => trim( $alt_attribute ),
);
printf( $html, get_permalink( $content_id ), wp_get_attachment_image( $post->ID, apply_filters( 'raindrops_pinup_image_size', $raindrops_image_size, get_the_ID() ), false, $attr ) );
$html = '
%1$s
';
printf( $html, get_the_title( $content_id ), absint( $content_id ) );
wp_reset_postdata();
}
}
if ( isset( $instance[ 'inline_style' ] ) && $instance[ 'content' ] == 'featured' && !is_single( $content_id ) ) {
if ( has_post_thumbnail( $content_id ) ) {
$html = '
%2$s';
$raindrops_image_size = 'midium';
if ( raindrops_warehouse_clone( 'raindrops_right_sidebar_width_percent' ) > 25 ) {
$raindrops_image_size = 'large';
}
$alt_attribute = wp_kses( get_the_title( $content_id ), array() );
$attr = array(
'alt' => trim( $alt_attribute ),
);
printf( $html, esc_url( get_permalink( $content_id ) ), get_the_post_thumbnail( $content_id, apply_filters( 'raindrops_pinup_image_size', $raindrops_image_size, get_the_ID() ) ), $attr );
$html = '
%1$s
';
printf( $html, get_the_title( $content_id ), absint( $content_id ) );
} else {
$html = '
';
printf( $html, get_the_title( $content_id ), absint( $content_id ), esc_url( get_permalink( $content_id ) ) );
}
}
if ( isset( $content_id ) ) {
echo '
';
}
echo $after_widget;
}
}
function update( $new_instance, $old_instance ) {
$instance[ 'title' ] = strip_tags( stripslashes( $new_instance[ 'title' ] ) );
$instance[ 'id' ] = strip_tags( stripslashes( $new_instance[ 'id' ] ) );
$instance[ 'content' ] = strip_tags( stripslashes( $new_instance[ 'content' ] ) );
$instance[ 'type' ] = strip_tags( stripslashes( $new_instance[ 'type' ] ) );
$instance[ 'display_type' ] = strip_tags( stripslashes( $new_instance[ 'display_type' ] ) );
$instance[ 'inline_style' ] = strip_tags( stripslashes( $new_instance[ 'inline_style' ] ) );
return $instance;
}
function form( $instance ) {
if ( isset( $instance[ 'title' ] ) ) {
$title = esc_attr( $instance[ 'title' ] );
} else {
$title = '';
}
if ( isset( $instance[ 'id' ] ) ) {
$id = esc_attr( $instance[ 'id' ] );
} else {
$id = '';
}
if ( isset( $instance[ 'content' ] ) ) {
$content = esc_attr( $instance[ 'content' ] );
$raindrops_content_checked = checked( $instance[ 'content' ], "content", false );
$puddele_excerpt_checked = checked( $instance[ 'content' ], "excerpt", false );
} else {
$content = 'content';
$raindrops_content_checked = "checked='checked'";
$puddele_excerpt_checked = "";
}
if ( isset( $instance[ 'type' ] ) ) {
$type = esc_attr( $instance[ 'type' ] );
} else {
$type = 'post';
}
if ( isset( $instance[ 'display_type' ] ) ) {
$display_type = esc_attr( $instance[ 'display_type' ] );
} else {
$display_type = 'grid';
}
if ( isset( $instance[ 'inline_style' ] ) ) {
$style = esc_textarea( $instance[ 'inline_style' ] );
} else {
$style = '';
}
if ( empty( $raindrops_content_checked ) && empty( $puddele_excerpt_checked ) ) {
$checked_default = "checked='checked'";
} else {
$checked_default = "";
}
$alert = '
' . esc_html__( 'Please check, incorrect value in post ID might have been set,', 'raindrops' ) . '';
$entry_title_names = $id;
if ( !empty( $entry_title_names ) ) {
if ( strpos( $entry_title_names, ',' ) ) {
$entry_title_names = explode( ',', $entry_title_names );
$has_been_set_title = '';
foreach ( $entry_title_names as $entry_title_name ) {
$title_val = get_the_title( $entry_title_name );
if ( !empty( $title_val ) ) {
$has_been_set_title .= $title_val . '
';
} else {
$has_been_set_title .= $alert . '
';
}
}
$entry_title_names = $has_been_set_title;
} else {
$entry_title_names = get_the_title( $entry_title_names );
if ( empty( $entry_title_names ) ) {
$entry_title_names = $alert;
}
}
$raindrops_html = '
%1$s
%2$s
';
printf( $raindrops_html, esc_html__( 'Posted title that has been set', 'raindrops' ), $entry_title_names );
}
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Title', 'raindrops' ), esc_attr( $this->get_field_id( 'title' ) ), esc_html__( 'Show only Display Type: Grid', 'raindrops' ), esc_attr( $this->get_field_id( 'title' ) ), esc_attr( $this->get_field_name( 'title' ) ), esc_html( $title )
);
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Post ID', 'raindrops' ), esc_attr( $this->get_field_id( 'id' ) ), esc_html__( 'Comma separated IDs', 'raindrops' ), esc_attr( $this->get_field_id( 'id' ) ), esc_attr( $this->get_field_name( 'id' ) ), esc_html( $id )
);
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Display Type', 'raindrops' ), esc_attr( $this->get_field_id( 'display_type' ) ), esc_attr( $this->get_field_name( 'display_type' ) ), checked( $display_type, "grid", false ), $checked_default, esc_html__( 'Grid Layout', 'raindrops' ), 'grid'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'display_type' ) ), esc_attr( $this->get_field_name( 'display_type' ) ), checked( $display_type, "randum", false ), esc_html__( 'Randum Show', 'raindrops' ), 'randum' );
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Post Type', 'raindrops' ), esc_attr( $this->get_field_id( 'type' ) ), esc_attr( $this->get_field_name( 'type' ) ), checked( $type, "post", false ), $checked_default, esc_html__( 'Post:', 'raindrops' ), 'post'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'type' ) ), esc_attr( $this->get_field_name( 'type' ) ), checked( $type, "page", false ), esc_html__( 'Page', 'raindrops' ), 'page'
);
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html( 'Content Type', 'raindrops' ), esc_attr( $this->get_field_id( 'content' ) ), esc_attr( $this->get_field_name( 'content' ) ), checked( $content, "content", false ), $checked_default, esc_html__( 'Content:', 'raindrops' ), 'content' );
$raindrops_html = '';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'content' ) ), esc_attr( $this->get_field_name( 'content' ) ), checked( $content, "excerpt", false ), esc_html__( 'Excerpt:', 'raindrops' ), 'excerpt'
);
$raindrops_html = '';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'content' ) ), esc_attr( $this->get_field_name( 'content' ) ), checked( $content, "attachment", false ), esc_html__( 'Attachment IMG:', 'raindrops' ), 'attachment'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'content' ) ), esc_attr( $this->get_field_name( 'content' ) ), checked( $content, "featured", false ), esc_html__( 'Featured IMG', 'raindrops' ), 'featured'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'inline_style' ) ), esc_attr( $this->get_field_name( 'inline_style' ) ), $style );
}
}
/**
* Raindrops Extend Archive Widget
*
* @since 1.270
*/
if ( !function_exists( 'raindrops_register_extend_archive_Widget' ) ) {
function raindrops_register_extend_archive_Widget() {
register_widget( 'raindrops_extend_archive_Widget' );
}
}
class raindrops_extend_archive_Widget extends WP_Widget {
public function __construct() {
$widget_ops = array(
'classname' => 'raindrops-extend-archive',
'description' => esc_html__( 'Archives Extended', 'raindrops' )
);
parent::__construct( false, esc_html__( '3.Archives Extended [Raindrops]', 'raindrops' ), $widget_ops );
wp_reset_query();
}
public function widget( $args, $instance ) {
global $wp_locale;
extract( $args );
echo $before_widget;
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
} else {
$title = esc_html__( "Archives", 'raindrops' );
}
if ( !empty( $title ) ) {
$result_html = $before_title;
$result_html .= apply_filters( 'widget_title', $title );
$result_html .= $after_title;
}
if ( isset( $instance[ 'archives_start_year' ] ) && is_numeric( $instance[ 'archives_start_year' ] ) ) {
$archives_start_year = absint( $instance[ 'archives_start_year' ] );
} else {
/* year of WordPress born */
$archives_start_year = 2003;
}
if ( isset( $instance[ 'group_year_month' ] ) && ( $instance[ 'group_year_month' ] == 'year' || $instance[ 'group_year_month' ] == 'month') ) {
$group_year_month = esc_attr( $instance[ 'group_year_month' ] );
} else {
$group_year_month = 'year';
}
if ( isset( $instance[ 'show_post_count' ] ) && ( $instance[ 'show_post_count' ] == 'yes' || $instance[ 'show_post_count' ] == 'no') ) {
if ( $instance[ 'show_post_count' ] == 'yes' ) {
$show_post_count = true;
}
if ( $instance[ 'show_post_count' ] == 'no' ) {
$show_post_count = false;
}
} else {
$show_post_count = false;
}
$archive_strings = wp_get_archives( apply_filters( 'widget_archives_args', array(
'type' => 'monthly',
'show_post_count' => $show_post_count,
'echo' => false,
'format' => 'custom',
'before' => ',' ) ) );
$archives_array = explode( ',', $archive_strings );
foreach ( $archives_array as $key => $each_links ) {
if ( preg_match( '!([0-9]{4})!', $each_links, $regs ) && $regs[ 1 ] < $archives_start_year ) {
unset( $archives_array[ $key ] );
}
}
$result = array();
$groups = $group_year_month;
$display_start_year = $archives_start_year;
$display_end_year = apply_filters( 'raindrops_extend_archive_widget_end_year', date( 'Y' ) );
if ( $groups == 'year' ) {
for ( $i = $display_start_year; $i < $display_end_year + 1; $i++ ) {
foreach ( $archives_array as $key => $val ) {
if ( preg_match( '!([0-9]{4})!', $val, $regs ) && $regs[ 1 ] == $i ) {
$result[ $i ][ $key ] = $val;
}
}
}
krsort( $result );
}
if ( $groups == 'month' ) {
for ( $i = 1; $i < 13; $i++ ) {
foreach ( $archives_array as $key => $val ) {
$month_name = $wp_locale->get_month( $i );
if ( preg_match( '![^0-9]' . $month_name . '!', $val ) ) {
$result[ $i ][ $key ] = $val;
}
}
}
}
$result_html .= '
';
/**
* @1.407
* $result_html .= raindrops_monthly_archive_prev_next_navigation( false, true );
*/
if ( $groups == 'year' ) {
foreach ( $result as $key => $val ) {
$year_link = get_year_link( absint( $key ) );
$year_label = apply_filters( 'raindrops_archive_year_label', esc_html( $key ) );
$result_html .= sprintf( '
', $year_link, absint( $key ), $year_label );
$month_name_before = array( 'January', 'February', 'March', 'April', 'MayJune', 'July', 'August', 'September', 'October', 'November', 'December' );
$month_name_after = array( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
foreach ( $val as $k => $v ) {
preg_match( '!>.*[^0-9]([0-9]{1,2})[^0-9].*' . $wp_locale->get_month( $regs[ 1 ] ) . '<', $v );
} else {
$class = trim( strtolower( wp_kses( $v, array() ) ) );
$class = trim( str_replace( array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, ' ', '(', ')', ' ' ), array( '', '', '', '', '', '', '', '', '', '', '-', '', '', '' ), $class ), '-' );
$class = esc_attr( 'month month-' . $class );
$v = preg_replace( '![^/=][0-9]{4}!', '', $v );
}
$v = str_replace( $month_name_before, $month_name_after, $v );
$result_html .= sprintf( '- %1$s%3$s
', $v, esc_attr( $class ), esc_html( $year_label ) );
}
$result_html .= '
';
}
$result_html .= '
';
echo $result_html;
}
if ( $groups == 'month' ) {
foreach ( $result as $key => $val ) {
$month_name = $wp_locale->get_month( $key );
$result_html .= sprintf( '
%1$s
', $month_name, esc_attr( $key ) );
foreach ( $val as $v ) {
$result_html .= sprintf( '- %1$s%3$s
', str_replace( $month_name, '', $v ), esc_attr( $key ), esc_html( $month_name ) );
}
$result_html .= '
';
}
echo $result_html;
}
echo $after_widget;
}
public function form( $instance ) {
$archives_start_year = '';
$group_year_month = '';
$show_post_count = '';
if ( isset( $instance[ 'title' ] ) ) {
$title = $instance[ 'title' ];
} else {
$title = esc_html__( "Archives", 'raindrops' );
}
if ( isset( $instance[ 'archives_start_year' ] ) ) {
$archives_start_year = esc_attr( $instance[ 'archives_start_year' ] );
}
if ( isset( $instance[ 'group_year_month' ] ) ) {
$group_year_month = esc_attr( $instance[ 'group_year_month' ] );
}
if ( isset( $instance[ 'show_post_count' ] ) ) {
$show_post_count = esc_attr( $instance[ 'show_post_count' ] );
}
if ( empty( $instance[ 'group_year_month' ] ) && empty( $group_year_month ) ) {
$raindrops_year_checked_default = "checked='checked'";
} else {
$raindrops_year_checked_default = "";
}
if ( empty( $instance[ 'show_post_count' ] ) && empty( $show_post_count ) ) {
$show_post_count_checked_default = "checked='checked'";
} else {
$show_post_count_checked_default = "";
}
?>
%1$s
';
printf( $raindrops_html, esc_html__( 'Display Archives Start Year', 'raindrops' ), esc_attr( $this->get_field_id( 'archives_start_year' ) ), esc_html__( 'Please use the 4-digit number or blank ex. 2010', 'raindrops' ), esc_attr( $this->get_field_id( 'archives_start_year' ) ), esc_attr( $this->get_field_name( 'archives_start_year' ) ), esc_html( $archives_start_year )
);
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Groop by Year, by Month', 'raindrops' ), esc_attr( $this->get_field_id( 'group_year_month' ) ), esc_attr( $this->get_field_name( 'group_year_month' ) ), checked( $group_year_month, "year", false ), $raindrops_year_checked_default, esc_html__( 'Year', 'raindrops' ), 'year'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'group_year_month' ) ), esc_attr( $this->get_field_name( 'group_year_month' ) ), checked( $group_year_month, "month", false ), esc_html__( 'Month', 'raindrops' ), 'month'
);
$raindrops_html = '
%1$s
';
printf( $raindrops_html, esc_html__( 'Show Post Count', 'raindrops' ), esc_attr( $this->get_field_id( 'show_post_count' ) ), esc_attr( $this->get_field_name( 'show_post_count' ) ), checked( $show_post_count, "no", false ), $show_post_count_checked_default, esc_html__( 'No', 'raindrops' ), 'no'
);
$raindrops_html = '
';
printf( $raindrops_html, esc_attr( $this->get_field_id( 'show_post_count' ) ), esc_attr( $this->get_field_name( 'show_post_count' ) ), checked( $show_post_count, "yes", false ), esc_html__( 'Yes', 'raindrops' ), 'yes'
);
}
public function update( $new_instance, $old_instance ) {
$instance[ 'archives_start_year' ] = strip_tags( stripslashes( $new_instance[ 'archives_start_year' ] ) );
$instance[ 'group_year_month' ] = strip_tags( stripslashes( $new_instance[ 'group_year_month' ] ) );
$instance[ 'show_post_count' ] = strip_tags( stripslashes( $new_instance[ 'show_post_count' ] ) );
$instance[ 'title' ] = strip_tags( stripslashes( $new_instance[ 'title' ] ) );
return $instance;
}
}
?>