From 1fdfe9da80447c13b34a5d742f8706bfb3a48eea Mon Sep 17 00:00:00 2001 From: Yehuda Ringler Date: Sun, 8 Aug 2021 15:10:18 -0400 Subject: [PATCH] add fields limit to post --- lib/requests/params_post_list.dart | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/requests/params_post_list.dart b/lib/requests/params_post_list.dart index 3ada10b..61daf6c 100644 --- a/lib/requests/params_post_list.dart +++ b/lib/requests/params_post_list.dart @@ -25,6 +25,7 @@ class ParamsPostList { final List includeTags; final List excludeTags; final bool? sticky; + final List fields; ParamsPostList({ this.context = WordPressContext.view, @@ -47,6 +48,7 @@ class ParamsPostList { this.includeTags = const [], this.excludeTags = const [], this.sticky, + this.fields = const [], }); Map toMap() { @@ -71,6 +73,7 @@ class ParamsPostList { 'tags': '${listToUrlString(includeTags)}', 'tags_exclude': '${listToUrlString(excludeTags)}', 'sticky': '${this.sticky == null ? '' : this.sticky}', + '_fields': this.fields.join(',') }; } @@ -98,7 +101,8 @@ ParamsPostList copyWith({ postStatus: postStatus, searchQuery: searchQuery, slug: slug, - sticky: sticky + sticky: sticky, + fields: fields, ); }