From 64ef3b619a55d47f7cc6d7419bce6623b017db45 Mon Sep 17 00:00:00 2001 From: william-man Date: Thu, 2 Apr 2026 17:30:12 +0100 Subject: [PATCH 1/2] Support all registered post types in chapter navigation --- spec/chapter_navigation.spec.php | 8 ++++---- src/ChapterNavigation.php | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spec/chapter_navigation.spec.php b/spec/chapter_navigation.spec.php index 56da8ea..5bb1a34 100644 --- a/spec/chapter_navigation.spec.php +++ b/spec/chapter_navigation.spec.php @@ -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) [ @@ -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' @@ -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) [ @@ -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' diff --git a/src/ChapterNavigation.php b/src/ChapterNavigation.php index 3441362..5308ed7 100644 --- a/src/ChapterNavigation.php +++ b/src/ChapterNavigation.php @@ -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' From bcd1375ca2d154493c7d857ede63ce65264da7e9 Mon Sep 17 00:00:00 2001 From: william-man Date: Thu, 2 Apr 2026 17:32:52 +0100 Subject: [PATCH 2/2] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e13d96..b5fdb80 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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