Skip to content
This repository was archived by the owner on Sep 15, 2025. It is now read-only.

Commit dd2a046

Browse files
Gerardowargcm
authored andcommitted
Update isFSETheme flag for both block-based themes and classic themes
1 parent 3d2b9e0 commit dd2a046

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

WordPressKit/RemoteBlockEditorSettings.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import Foundation
22

33
public class RemoteBlockEditorSettings: Codable {
44
enum CodingKeys: String, CodingKey {
5-
case isFSETheme = "__unstableEnableFullSiteEditingBlocks"
65
case galleryWithImageBlocks = "__unstableGalleryWithImageBlocks"
76
case quoteBlockV2 = "__experimentalEnableQuoteBlockV2"
87
case listBlockV2 = "__experimentalEnableListBlockV2"
@@ -39,7 +38,7 @@ public class RemoteBlockEditorSettings: Codable {
3938

4039
required public init(from decoder: Decoder) throws {
4140
let map = try decoder.container(keyedBy: CodingKeys.self)
42-
self.isFSETheme = (try? map.decode(Bool.self, forKey: .isFSETheme)) ?? false
41+
self.isFSETheme = ((try? map.decode([String: Any].self, forKey: .rawStyles)) != nil) ? true : false
4342
self.galleryWithImageBlocks = (try? map.decode(Bool.self, forKey: .galleryWithImageBlocks)) ?? false
4443
self.quoteBlockV2 = (try? map.decode(Bool.self, forKey: .quoteBlockV2)) ?? false
4544
self.listBlockV2 = (try? map.decode(Bool.self, forKey: .listBlockV2)) ?? false
@@ -66,14 +65,17 @@ public struct RemoteEditorThemeSupport: Codable {
6665
enum CodingKeys: String, CodingKey {
6766
case colors = "editor-color-palette"
6867
case gradients = "editor-gradient-presets"
68+
case blockTemplates = "block-templates"
6969
}
7070

7171
public let colors: [[String: String]]?
7272
public let gradients: [[String: String]]?
73+
public let blockTemplates: Bool
7374

7475
public init(from decoder: Decoder) throws {
7576
let map = try decoder.container(keyedBy: CodingKeys.self)
7677
self.colors = try? map.decode([[String: String]].self, forKey: .colors)
7778
self.gradients = try? map.decode([[String: String]].self, forKey: .gradients)
79+
self.blockTemplates = ((try? map.decode(Bool.self, forKey: .blockTemplates)) != nil)
7880
}
7981
}

0 commit comments

Comments
 (0)