Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check required WordPress version to set galleryWithImageBlocks flag #20736

Merged
merged 5 commits into from
May 30, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Foundation
import WordPressKit
import Gutenberg
import Blog

extension BlockEditorSettings: GutenbergEditorSettings {
public var colors: [[String: String]]? {
Expand All @@ -12,7 +13,14 @@ extension BlockEditorSettings: GutenbergEditorSettings {
}

public var galleryWithImageBlocks: Bool {
return experimentalFeature(.galleryWithImageBlocks)
// If site is using WP 5.9+ then return true as galleryWithImageBlocks is supported in WP 5.9+.
// Once support for WP 5.8 is dropped, this can be removed.
// https://github.com/WordPress/gutenberg/issues/47782
if hasRequiredWordPressVersion("5.9") {
return true
} else {
return experimentalFeature(.galleryWithImageBlocks)
}
twstokes marked this conversation as resolved.
Show resolved Hide resolved
}

public var quoteBlockV2: Bool {
Expand Down