Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## UNRELEASED

### Changed

- Chapter navigation now supports all post types instead of long-read only

## [v2.1.0] - 2026-04-01

### Added
Expand Down
8 changes: 4 additions & 4 deletions spec/chapter_navigation.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
});

describe('->getItems()', function () {
context('global post is the parent long-read post', function () {
context('global post is a parent post', function () {
it('returns an array of items with the first item as the current post, which will have a null url property', function () {
global $post;
$post = (object) [
Expand All @@ -28,7 +28,7 @@
]);
expect('get_posts')->toBeCalled()->once()->with([
'post_parent' => 123,
'post_type' => 'long-read',
'post_type' => 'any',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
Expand All @@ -47,7 +47,7 @@
});
});

context('global post is a child long-read post', function () {
context('global post is a child post', function () {
it('returns an array of items with the current post in the appropriate place, and with a null url property', function () {
global $post;
$post = (object) [
Expand All @@ -71,7 +71,7 @@
]);
expect('get_posts')->toBeCalled()->once()->with([
'post_parent' => 123,
'post_type' => 'long-read',
'post_type' => 'any',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
Expand Down
2 changes: 1 addition & 1 deletion src/ChapterNavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public function getItems(): array
$parentPost = $potentialParent ? $potentialParent : $post;
$chapterPosts = get_posts([
'post_parent' => $parentPost->ID,
'post_type' => 'long-read',
'post_type' => 'any',
'posts_per_page' => -1,
'orderby' => 'menu_order',
'order' => 'ASC'
Expand Down
Loading