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

Commit b53d94b

Browse files
committed
Update editor settings and theme support models for block themes support
Changes the `isFSETheme` key on the model `RemoteBlockEditorSettings` to use `__unstableIsBlockBasedTheme`. Additionally, updates `blockTemplates` on `RemoteEditorThemeSupport` to use the bool from the response.
1 parent dd2a046 commit b53d94b

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

WordPressKit.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Pod::Spec.new do |s|
44
s.name = 'WordPressKit'
5-
s.version = '8.0.0'
5+
s.version = '8.1.0-beta.1'
66

77
s.summary = 'WordPressKit offers a clean and simple WordPress.com and WordPress.org API.'
88
s.description = <<-DESC

WordPressKit/RemoteBlockEditorSettings.swift

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

33
public class RemoteBlockEditorSettings: Codable {
44
enum CodingKeys: String, CodingKey {
5+
case isFSETheme = "__unstableIsBlockBasedTheme"
56
case galleryWithImageBlocks = "__unstableGalleryWithImageBlocks"
67
case quoteBlockV2 = "__experimentalEnableQuoteBlockV2"
78
case listBlockV2 = "__experimentalEnableListBlockV2"
@@ -38,7 +39,7 @@ public class RemoteBlockEditorSettings: Codable {
3839

3940
required public init(from decoder: Decoder) throws {
4041
let map = try decoder.container(keyedBy: CodingKeys.self)
41-
self.isFSETheme = ((try? map.decode([String: Any].self, forKey: .rawStyles)) != nil) ? true : false
42+
self.isFSETheme = (try? map.decode(Bool.self, forKey: .isFSETheme)) ?? false
4243
self.galleryWithImageBlocks = (try? map.decode(Bool.self, forKey: .galleryWithImageBlocks)) ?? false
4344
self.quoteBlockV2 = (try? map.decode(Bool.self, forKey: .quoteBlockV2)) ?? false
4445
self.listBlockV2 = (try? map.decode(Bool.self, forKey: .listBlockV2)) ?? false
@@ -76,6 +77,6 @@ public struct RemoteEditorThemeSupport: Codable {
7677
let map = try decoder.container(keyedBy: CodingKeys.self)
7778
self.colors = try? map.decode([[String: String]].self, forKey: .colors)
7879
self.gradients = try? map.decode([[String: String]].self, forKey: .gradients)
79-
self.blockTemplates = ((try? map.decode(Bool.self, forKey: .blockTemplates)) != nil)
80+
self.blockTemplates = (try? map.decode(Bool.self, forKey: .blockTemplates)) ?? false
8081
}
8182
}

0 commit comments

Comments
 (0)