Skip to content

Commit

Permalink
Add theme type information (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
guarani authored Mar 13, 2024
2 parents 3c370cb + 1253baf commit 755fb4a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ _None._

### Internal Changes

_None._
- Add WP.com theme type information. [#750]

## 14.0.1

Expand Down
1 change: 1 addition & 0 deletions WordPressKit/RemoteTheme.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
@interface RemoteTheme : NSObject

@property (nonatomic, assign) BOOL active;
@property (nonatomic, strong) NSString *type;
@property (nonatomic, strong) NSString *author;
@property (nonatomic, strong) NSString *authorUrl;
@property (nonatomic, strong) NSString *desc;
Expand Down
2 changes: 2 additions & 0 deletions WordPressKit/ThemeServiceRemote.m
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ - (RemoteTheme *)themeFromDictionary:(NSDictionary *)dictionary
NSParameterAssert([dictionary isKindOfClass:[NSDictionary class]]);

static NSString* const ThemeActiveKey = @"active";
static NSString* const ThemeTypeKey = @"theme_type";
static NSString* const ThemeAuthorKey = @"author";
static NSString* const ThemeAuthorURLKey = @"author_uri";
static NSString* const ThemeCostPath = @"cost.number";
Expand All @@ -384,6 +385,7 @@ - (RemoteTheme *)themeFromDictionary:(NSDictionary *)dictionary
[self loadLaunchDateForTheme:theme fromDictionary:dictionary];

theme.active = [[dictionary numberForKey:ThemeActiveKey] boolValue];
theme.type = [dictionary stringForKey:ThemeTypeKey];
theme.author = [dictionary stringForKey:ThemeAuthorKey];
theme.authorUrl = [dictionary stringForKey:ThemeAuthorURLKey];
theme.demoUrl = [dictionary stringForKey:ThemeDemoURLKey];
Expand Down

0 comments on commit 755fb4a

Please sign in to comment.