Skip to content

Commit 44c1496

Browse files
committed
Fixed categories
- Fixed pagination for categories. Without this PHP would spin it's wheels into infinite
1 parent fd56a39 commit 44c1496

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/Model/Api/ApiAbstract.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ public function getCollection($params = array())
9191
$collection = $this->_createCollection(\Zend_Json::decode($response->getBody()));
9292

9393
if ($totalPages = $response->getHeader('X-WP-TotalPages')) {
94+
if(is_array($totalPages))
95+
$totalPages = $totalPages[0];
9496
$collection->setLastPageNumber($totalPages);
9597
}
9698

src/etc/module.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
22
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
3-
<module name="Skywire_WordpressApi" setup_version="1.5.1">
3+
<module name="Skywire_WordpressApi" setup_version="1.5.2">
44
</module>
55
</config>

0 commit comments

Comments
 (0)