PluginProbe
WebberZone Top 10 — Popular Posts / 4.5.2
WebberZone Top 10 — Popular Posts v4.5.2
4.5.2 4.5.1 4.5.0 4.4.3 4.4.2 4.4.1 4.4.0 4.3.4 4.3.3 4.3.2 4.3.1 4.3.0 trunk 1.0 1.0.1 1.1 1.2 1.3 1.4 1.4.1 1.5 1.5.1 1.5.2 1.5.3 1.6 All 118 releases
← All changes | includes/frontend/class-media-handler.php +17 -5 4.5.0 → 4.5.2 View file →
@@ -129,11 +129,11 @@
129 129
130 130 if ( is_string( $args['size'] ) ) {
131 131 list( $args['thumb_width'], $args['thumb_height'] ) = self::get_thumb_size( $args['size'] );
132 132 } else {
133 - $args['thumb_width'] = $args['size'][0];
134 - $args['thumb_height'] = $args['size'][1];
135 - $args['size'] = self::get_appropriate_image_size( $args['size'][0], $args['size'][1] );
133 + $args['thumb_width'] = absint( $args['size'][0] );
134 + $args['thumb_height'] = absint( $args['size'][1] );
135 + $args['size'] = self::get_appropriate_image_size( $args['thumb_width'], $args['thumb_height'] );
136 136 }
137 137
138 138 $post_title = esc_attr( $result->post_title );
139 139
@@ -965,12 +965,24 @@
965 965 );
966 966
967 967 $args = wp_parse_args( $args, $default_args );
968 968
969 + $thumb_width = absint( $args['thumb_width'] );
970 + $thumb_height = absint( $args['thumb_height'] );
971 +
969 972 if ( 'css' === $args['thumb_html'] ) {
970 - $thumb_html = ' style="max-width:' . $args['thumb_width'] . 'px;max-height:' . $args['thumb_height'] . 'px;" ';
973 + $styles = array();
974 + if ( $thumb_width ) {
975 + $styles[] = 'max-width:' . $thumb_width . 'px';
976 + }
977 + if ( $thumb_height ) {
978 + $styles[] = 'max-height:' . $thumb_height . 'px';
979 + }
980 + $thumb_html = $styles ? ' style="' . implode( ';', $styles ) . ';" ' : '';
971 981 } elseif ( 'html' === $args['thumb_html'] ) {
972 - $thumb_html = ' width="' . $args['thumb_width'] . '" height="' . $args['thumb_height'] . '" ';
982 + $thumb_html = $thumb_width ? ' width="' . $thumb_width . '"' : '';
983 + $thumb_html .= $thumb_height ? ' height="' . $thumb_height . '"' : '';
984 + $thumb_html = $thumb_html ? $thumb_html . ' ' : '';
973 985 } else {
974 986 $thumb_html = '';
975 987 }
976 988