Auto-link URLs in plain text content - #314
Open
pfefferle wants to merge 2 commits into
Open
Conversation
pfefferle
force-pushed
the
fix/303-autolink-urls-in-plain-text
branch
from
January 11, 2026 22:38
af535dd to
da50f52
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds automatic URL linking functionality to plain text content submitted via the Micropub endpoint. When users submit posts with plain text content containing URLs, those URLs will now be automatically converted to clickable HTML links using WordPress's make_clickable() function.
Changes:
- Modified the content processing logic to apply
make_clickable()to plain text content after HTML escaping - Added comprehensive test coverage for both plain text auto-linking and HTML content preservation scenarios
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| includes/rest/class-endpoint-controller.php | Updated mp_to_wp() method to apply make_clickable() to plain text content while preserving HTML content as-is |
| tests/test_endpoint.php | Added 6 new test cases covering plain text URL auto-linking, multiple URLs, and verification that HTML content remains unchanged |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Use WordPress's make_clickable() function to automatically convert URLs in plain text content to clickable links. This only applies to plain text content, not HTML content which is preserved as-is. Fixes #303
pfefferle
force-pushed
the
fix/303-autolink-urls-in-plain-text
branch
from
July 8, 2026 10:44
da50f52 to
c02afb0
Compare
Apply make_clickable() to the content value fallback as well, so plain text is auto-linked consistently whether it arrives as a string or as an array with a value property. Guard the html key access while at it: a value-only content array previously triggered an undefined array key warning on PHP 8.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
make_clickable()function to automatically convert URLs in plain text content to clickable linksFixes #303