Skip to content

Commit

Permalink
Add BranchPrivacyPolicy and remove BranchPaged
Browse files Browse the repository at this point in the history
Uptate compat with latest WP versions
  • Loading branch information
gmazzap committed Feb 8, 2022
1 parent 7def8bf commit 85bc480
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@
* @author Giuseppe Mazzapica <[email protected]>
* @license http://opensource.org/licenses/MIT MIT
*/
final class BranchPaged implements Branch
final class BranchPrivacyPolicy implements Branch
{
/**
* @return string
*/
public function name(): string
{
return 'paged';
return 'privacy_policy';
}

/**
Expand All @@ -33,7 +33,7 @@ public function name(): string
*/
public function is(\WP_Query $query): bool
{
return $query->is_paged();
return $query->is_privacy_policy();
}

/**
Expand All @@ -42,6 +42,6 @@ public function is(\WP_Query $query): bool
*/
public function leaves(\WP_Query $query): array
{
return ['paged'];
return ['privacy-policy'];
}
}
2 changes: 1 addition & 1 deletion src/Hierarchy.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class Hierarchy
'search' => Branch\BranchSearch::class,
'frontpage' => Branch\BranchFrontPage::class,
'home' => Branch\BranchHome::class,
'privacy_policy' => Branch\BranchPrivacyPolicy::class,
'post-type-archive' => Branch\BranchPostTypeArchive::class,
'taxonomy' => Branch\BranchTaxonomy::class,
'attachment' => Branch\BranchAttachment::class,
Expand All @@ -41,7 +42,6 @@ class Hierarchy
'author' => Branch\BranchAuthor::class,
'date' => Branch\BranchDate::class,
'archive' => Branch\BranchArchive::class,
'paged' => Branch\BranchPaged::class,
];

/**
Expand Down

0 comments on commit 85bc480

Please sign in to comment.