Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions source/php/Module/Posts/Posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public function data(): array
{
$data = [];
$this->fields = $this->getFields();

$this->domainChecker = new DomainChecker($this->fields);
$data['posts_display_as'] = $this->fields['posts_display_as'] ?? false;
$data['display_reading_time'] = !empty($this->fields['posts_fields']) && in_array('reading_time', $this->fields['posts_fields']) ?? false;
Expand Down Expand Up @@ -211,8 +212,8 @@ public function data(): array
'next' => __('Next slide', 'modularity'),
];

if ($this->ID) {
$data['sliderId'] = $this->ID;
if ($this->getID()) {
$data['sliderId'] = $this->getID();
} else {
$data['sliderId'] = uniqid();
$data['ID'] = uniqid();
Expand Down Expand Up @@ -241,7 +242,7 @@ public function data(): array
* @return string
*/
private function getPaginationQueryVarName():string {
return "{$this->post_type}-{$this->ID}-page";
return "{$this->slug}-{$this->getID()}-page";
}

/**
Expand All @@ -262,7 +263,7 @@ private function getPageNumber():int {
*/
private function getPaginationArguments(int $maxNumPages, int $currentPage):array {

if($maxNumPages < 2) {
if ($maxNumPages < 2) {
return [];
}

Expand All @@ -280,7 +281,8 @@ private function getPaginationArguments(int $maxNumPages, int $currentPage):arra

return [
'list' => array_merge([$listItemOne], $listItems),
'current' => $currentPage
'current' => $currentPage,
'linkPrefix' => $this->getPaginationQueryVarName()
];
}

Expand Down