Skip to content

Commit 244b6c4

Browse files
committed
Revert "Add search parameter to getWPThemesPage method"
This reverts commit 074fc43.
1 parent affb54f commit 244b6c4

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

Sources/WordPressKit/Services/ThemeServiceRemote.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,13 @@ typedef void(^ThemeServiceRemoteFailureBlock)(NSError *error);
6060
*
6161
* @param freeOnly Only fetch free themes, if false all WP themes will be returned
6262
* @param page Results page to return.
63-
* @param search Search term to filter themes. Can be nil or empty string.
6463
* @param success The success handler. Can be nil.
6564
* @param failure The failure handler. Can be nil.
6665
*
6766
* @returns A progress object that can be used to track progress and/or cancel the task
6867
*/
6968
- (NSProgress *)getWPThemesPage:(NSInteger)page
7069
freeOnly:(BOOL)freeOnly
71-
search:(NSString *)search
7270
success:(ThemeServiceRemoteThemesRequestSuccessBlock)success
7371
failure:(ThemeServiceRemoteFailureBlock)failure;
7472

Sources/WordPressKit/Services/ThemeServiceRemote.m

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ - (NSProgress *)getThemeId:(NSString*)themeId
9999

100100
- (NSProgress *)getWPThemesPage:(NSInteger)page
101101
freeOnly:(BOOL)freeOnly
102-
search:(NSString *)search
103102
success:(ThemeServiceRemoteThemesRequestSuccessBlock)success
104103
failure:(ThemeServiceRemoteFailureBlock)failure
105104
{
@@ -108,15 +107,10 @@ - (NSProgress *)getWPThemesPage:(NSInteger)page
108107
NSString *requestUrl = [self pathForEndpoint:@"themes"
109108
withVersion:WordPressComRESTAPIVersion_1_2];
110109

111-
NSMutableDictionary *parameters = [@{
112-
ThemeRequestTierKey: freeOnly ? ThemeRequestTierFreeValue : ThemeRequestTierAllValue,
113-
ThemeRequestNumberKey: @(ThemeRequestNumberValue),
114-
ThemeRequestPageKey: @(page)
115-
} mutableCopy];
116-
117-
if (search && search.length > 0) {
118-
parameters[@"search"] = search;
119-
}
110+
NSDictionary *parameters = @{ThemeRequestTierKey: freeOnly ? ThemeRequestTierFreeValue : ThemeRequestTierAllValue,
111+
ThemeRequestNumberKey: @(ThemeRequestNumberValue),
112+
ThemeRequestPageKey: @(page),
113+
};
120114

121115
return [self getThemesWithRequestUrl:requestUrl
122116
page:page

Tests/WordPressKitTests/Tests/ThemeServiceRemoteTests.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ - (void)testThatGetThemesWorks
225225

226226
XCTAssertNoThrow([service getWPThemesPage:1
227227
freeOnly:NO
228-
search:nil
229228
success:successBlock
230229
failure:nil]);
231230
}

0 commit comments

Comments
 (0)