Skip to content

Conversation

@zhyian
Copy link
Contributor

@zhyian zhyian commented Oct 20, 2025

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
In WordPress multisite installations, the main site often has /blog prepended to post permalinks.

What is the new behavior (if this is a feature change)?
Added new module to automatically remove /blog prefix from the main site's permalink structure in WordPress multisite installations.

Does this PR introduce a breaking change? (What changes might users need to make in their application due to this PR?)
No

Other information:
Closes #24

@zhyian zhyian requested a review from lloc as a code owner October 20, 2025 14:06
@zhyian zhyian self-assigned this Oct 20, 2025
@zhyian zhyian added the enhancement New feature or request label Oct 20, 2025
Co-authored-by: Sören Wünsch <[email protected]>
Signed-off-by: Oleksandr Zhyian <[email protected]>
Copy link
Member

@lloc lloc left a comment

Choose a reason for hiding this comment

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

I like the PR, thanks for sending it. :-)

I have just one doubt, since we declare compatibility with PHP 7.4 🙈. Wouldn't it be better to have a polyfill for str_starts_with?

We should probably introduce a PHP matrix in our test workflow (in another PR maybe).

@zhyian
Copy link
Contributor Author

zhyian commented Oct 21, 2025

Thanks, for the feedback. Since this module runs within WordPress context, str_starts_with() is guaranteed to be available via WordPress's polyfill added in 5.9.0.
Do you believe this may be insufficient?

@lloc
Copy link
Member

lloc commented Oct 21, 2025

@zhyian I guess it does. :-) Also, we declared that we want to have at least WordPress 6.8.

@lloc lloc merged commit 02f780c into main Oct 21, 2025
4 checks passed
@lloc lloc deleted the feature/permalink-cleanup branch October 21, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Blog page in a multisite get prefix /blog - why?

3 participants