Skip to content

Commit 8189d71

Browse files
Remove unused old function
1 parent ae82ccd commit 8189d71

File tree

1 file changed

+0
-47
lines changed

1 file changed

+0
-47
lines changed

plugins/auto-sizes/includes/improve-calculate-sizes.php

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -233,53 +233,6 @@ function auto_sizes_format_sizes_attribute( string $alignment, string $width ):
233233
: sprintf( '(max-width: %1$s) 100vw, %1$s', $width );
234234
}
235235

236-
/**
237-
* Generates the `sizes` attribute value based on block information.
238-
*
239-
* @since n.e.x.t
240-
*
241-
* @param string $alignment The alignment.
242-
* @param int $image_width The image width.
243-
* @param bool $print_sizes Print the sizes attribute. Default is false.
244-
* @return string The sizes attribute value.
245-
*/
246-
function auto_sizes_get_sizes_by_block_alignments( string $alignment, int $image_width, bool $print_sizes = false ): string {
247-
$sizes = '';
248-
249-
$layout = auto_sizes_get_layout_settings();
250-
251-
// Handle different alignment use cases.
252-
switch ( $alignment ) {
253-
case 'full':
254-
$sizes = '100vw';
255-
break;
256-
257-
case 'wide':
258-
if ( array_key_exists( 'wideSize', $layout ) ) {
259-
$sizes = $layout['wideSize'];
260-
}
261-
break;
262-
263-
case 'left':
264-
case 'right':
265-
case 'center':
266-
$sizes = auto_sizes_get_width( '', $image_width );
267-
break;
268-
269-
default:
270-
if ( array_key_exists( 'contentSize', $layout ) ) {
271-
$sizes = auto_sizes_get_width( $layout['contentSize'], $image_width );
272-
}
273-
break;
274-
}
275-
276-
if ( $print_sizes ) {
277-
$sizes = 'full' === $alignment ? $sizes : sprintf( '(max-width: %1$s) 100vw, %1$s', $sizes );
278-
}
279-
280-
return $sizes;
281-
}
282-
283236
/**
284237
* Filters the context keys that a block type uses.
285238
*

0 commit comments

Comments
 (0)