Skip to content

Commit 236e226

Browse files
committed
Remove BlockEdit filter for image size in favor of PHP filter
If the 'full' size image is never needed in AMP stories, this could be much simpler. It's removed whenever the 'post_type' is 'amp_story'. This might need more thought, though.
1 parent 2a0d121 commit 236e226

File tree

4 files changed

+1
-69
lines changed

4 files changed

+1
-69
lines changed

assets/src/stories-editor/components/higher-order/with-replaced-full-size-image.js

-66
This file was deleted.

assets/src/stories-editor/components/index.js

-1
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,4 @@ export { default as withWrapperProps } from './with-wrapper-props';
3030
export { default as withActivePageState } from './with-active-page-state';
3131
export { default as withStoryBlockDropZone } from './with-story-block-drop-zone';
3232
export { default as withCallToActionValidation } from './higher-order/with-call-to-action-validation';
33-
export { default as withReplacedFullSizeImage } from './higher-order/with-replaced-full-size-image';
3433
export { default as withVideoPosterImageNotice } from './higher-order/with-video-poster-image-notice';

assets/src/stories-editor/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import {
3131
withActivePageState,
3232
withStoryBlockDropZone,
3333
withCallToActionValidation,
34-
withReplacedFullSizeImage,
3534
withVideoPosterImageNotice,
3635
} from './components';
3736
import {
@@ -297,7 +296,6 @@ addFilter( 'blocks.getSaveContent.extraProps', 'ampStoryEditorBlocks/addExtraAtt
297296
addFilter( 'blocks.getSaveElement', 'ampStoryEditorBlocks/wrapBlocksInGridLayer', wrapBlocksInGridLayer );
298297
addFilter( 'editor.BlockDropZone', 'ampStoryEditorBlocks/withStoryBlockDropZone', withStoryBlockDropZone );
299298
addFilter( 'editor.BlockEdit', 'ampStoryEditorBlocks/withCallToActionValidation', withCallToActionValidation );
300-
addFilter( 'editor.BlockEdit', 'ampStoryEditorBlocks/withReplacedFullSizeImage', withReplacedFullSizeImage );
301299
addFilter( 'blocks.getBlockAttributes', 'ampStoryEditorBlocks/filterBlockAttributes', filterBlockAttributes );
302300

303301
const blocks = require.context( './blocks', true, /(?<!test\/)index\.js$/ );

includes/class-amp-story-post-type.php

+1
Original file line numberDiff line numberDiff line change
@@ -1529,6 +1529,7 @@ public static function change_embed_iframe_attributes( $output, $post ) {
15291529
*/
15301530
public static function add_new_max_image_size( $image_sizes ) {
15311531
if ( self::POST_TYPE_SLUG === get_post_type() ) {
1532+
unset( $image_sizes['full'] );
15321533
$image_sizes[ self::STORY_PAGE_IMAGE_SIZE ] = __( 'Story Background', 'amp' );
15331534
}
15341535

0 commit comments

Comments
 (0)