Skip to content

Commit 1fdfe9d

Browse files
committed
add fields limit to post
1 parent 62fa89d commit 1fdfe9d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/requests/params_post_list.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ParamsPostList {
2525
final List<int> includeTags;
2626
final List<int> excludeTags;
2727
final bool? sticky;
28+
final List<String> fields;
2829

2930
ParamsPostList({
3031
this.context = WordPressContext.view,
@@ -47,6 +48,7 @@ class ParamsPostList {
4748
this.includeTags = const [],
4849
this.excludeTags = const [],
4950
this.sticky,
51+
this.fields = const [],
5052
});
5153

5254
Map<String, String> toMap() {
@@ -71,6 +73,7 @@ class ParamsPostList {
7173
'tags': '${listToUrlString(includeTags)}',
7274
'tags_exclude': '${listToUrlString(excludeTags)}',
7375
'sticky': '${this.sticky == null ? '' : this.sticky}',
76+
'_fields': this.fields.join(',')
7477
};
7578
}
7679

@@ -98,7 +101,8 @@ ParamsPostList copyWith({
98101
postStatus: postStatus,
99102
searchQuery: searchQuery,
100103
slug: slug,
101-
sticky: sticky
104+
sticky: sticky,
105+
fields: fields,
102106
);
103107
}
104108

0 commit comments

Comments
 (0)