- setAttributes( { displayFeaturedImage: value } )
- }
- className="latest-posts-toggle-control-margin-bottom"
- />
- { displayFeaturedImage && (
- <>
-
- {
- const newAttrs = {};
- if ( value.hasOwnProperty( 'width' ) ) {
- newAttrs.featuredImageSizeWidth =
- value.width;
- }
- if (
- value.hasOwnProperty( 'height' )
- ) {
- newAttrs.featuredImageSizeHeight =
- value.height;
- }
- setAttributes( newAttrs );
- } }
- slug={ featuredImageSizeSlug }
- width={ featuredImageSizeWidth }
- height={ featuredImageSizeHeight }
- imageWidth={ defaultImageWidth }
- imageHeight={ defaultImageHeight }
- imageSizeOptions={ imageSizeOptions }
- imageSizeHelp={ __(
- 'Select the size of the source image.'
- ) }
- onChangeImage={ ( value ) =>
- setAttributes( {
- featuredImageSizeSlug: value,
- featuredImageSizeWidth: undefined,
- featuredImageSizeHeight: undefined,
- } )
- }
- />
-
-
- setAttributes( {
- featuredImageAlign:
- value !== 'none'
- ? value
- : undefined,
- } )
+ />
+ { displayFeaturedImage && (
+ <>
+ {
+ const newAttrs = {};
+ if ( value.hasOwnProperty( 'width' ) ) {
+ newAttrs.featuredImageSizeWidth =
+ value.width;
}
- >
- { imageAlignmentOptions.map(
- ( { value, icon, label } ) => {
- return (
-
- );
- }
- ) }
-
-
- setAttributes( {
- addLinkToFeaturedImage: value,
- } )
+ if ( value.hasOwnProperty( 'height' ) ) {
+ newAttrs.featuredImageSizeHeight =
+ value.height;
}
- className="latest-posts-toggle-control-margin-top"
- />
- >
- ) }
-