Skip to content

Commit

Permalink
Add new Media section to preferences modal (#64846)
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy authored Sep 5, 2024
1 parent 57c59d1 commit 9523fb4
Show file tree
Hide file tree
Showing 3 changed files with 228 additions and 172 deletions.
7 changes: 7 additions & 0 deletions packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,13 @@ export function initializeEditor(
isPublishSidebarEnabled: true,
} );

if ( window.__experimentalMediaProcessing ) {
dispatch( preferencesStore ).setDefaults( 'core/media', {
requireApproval: true,
optimizeOnUpload: true,
} );
}

dispatch( blocksStore ).reapplyBlockTypeFilters();

// Check if the block list view should be open by default.
Expand Down
7 changes: 7 additions & 0 deletions packages/edit-site/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export function initializeEditor( id, settings ) {
showListViewByDefault: false,
} );

if ( window.__experimentalMediaProcessing ) {
dispatch( preferencesStore ).setDefaults( 'core/media', {
requireApproval: true,
optimizeOnUpload: true,
} );
}

dispatch( editSiteStore ).updateSettings( settings );

// Keep the defaultTemplateTypes in the core/editor settings too,
Expand Down
Loading

0 comments on commit 9523fb4

Please sign in to comment.