Skip to content

use current page and teaser for the description - #47

Merged
pfefferle merged 1 commit into
mainfrom
multipage-description
Sep 18, 2026
Merged

pfefferle merged 1 commit into
mainfrom
multipage-description

Conversation

@pfefferle

Copy link
Copy Markdown
Owner

Fixes #9

The description was always built from the whole post_content, so every page of a multipage post got the same one. It now uses core's generate_postdata() to pick the page from the page query var (works for the classic <!--nextpage--> and the block form).

While at it, the description is cut at the <!--more--> tag, the same way we do it in the ActivityPub plugin. That is a small behavior change for posts with a more tag, they get the teaser instead of the first 55 words.

og:url still points to the first page, I left that alone for now.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The changes are fully reviewed, tested, and have no unresolved blocking issues.

Pull request overview

Updates Open Graph descriptions to use the current multipage section and teaser content.

Changes:

  • Selects the current page with generate_postdata().
  • Stops descriptions at <!--more-->.
  • Adds regression tests for both behaviors.
File summaries
File Summary
tests/phpunit/tests/class-test-opengraph.php Adds multipage and teaser coverage.
opengraph.php Implements page-specific teaser extraction.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@pfefferle
pfefferle merged commit 9badbce into main Sep 18, 2026
5 checks passed
@pfefferle pfefferle mentioned this pull request Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support multipage posts

2 participants