File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -290,8 +290,8 @@ class WordPress {
290290 ));
291291 }
292292
293- if (fetchAll && response.headers["X-WP-TotalPages " ] != null ) {
294- final totalPages = int .parse (response.headers["X-WP-TotalPages " ]);
293+ if (fetchAll && response.headers["x-wp-totalpages " ] != null ) {
294+ final totalPages = int .parse (response.headers["x-wp-totalpages " ]);
295295
296296 for (int i = postParams.pageNum + 1 ; i <= totalPages; ++ i) {
297297 posts.addAll (await fetchPosts (
@@ -579,9 +579,9 @@ class WordPress {
579579 list.forEach ((category) {
580580 categories.add (Category .fromJson (category));
581581 });
582-
583- if (fetchAll && response.headers["X-WP-TotalPages " ] != null ) {
584- final totalPages = int .tryParse (response.headers["X-WP-TotalPages " ]) ?? 1 ;
582+
583+ if (fetchAll && response.headers["x-wp-totalpages " ] != null ) {
584+ final totalPages = int .parse (response.headers["x-wp-totalpages " ]);
585585
586586 for (int i = params.pageNum + 1 ; i <= totalPages; ++ i) {
587587 categories.addAll (await fetchCategories (
You can’t perform that action at this time.
0 commit comments