Repository navigation
Conversation
… front end Closed and disabled plugins already show their slug instead of their name in the plugin header, see [6469]. The document title, og:title, and the Contributors & Developers section still used the plugin name. Filter the_title and single_post_title on the front end instead, so every place that reads the title gets the slug, and drop the header's own special case. Fixes #8111. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. Props Bot commandsYou can trigger Props Bot actions by commenting on this PR:
|
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
There was a problem hiding this comment.
🟡 Changes recommended
The title-filter callback does not resolve the current post when its optional argument is absent, so disabled or closed plugins can still expose their names.
1 open issue
What changed in this PR
Updates the Plugin Directory theme so closed and disabled plugins consistently display their slug on the front end while preserving their names in wp-admin and the REST API.
Changes:
- Adds front-end
the_titleandsingle_post_titlefilters for closed and disabled plugins. - Uses the filtered title for the plugin header.
- Applies the slug consistently to document titles, Open Graph metadata, and contributor messaging.
The single_post_title callback currently receives no post argument from WordPress core and therefore does not apply the slug substitution. Resolve the queried post when the argument is absent.
| File | Summary |
|---|---|
wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/functions.php |
Adds front-end title filters. Moderate issue: the single_post_title callback needs to resolve the queried post when no post argument is provided. (2 votes) |
wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/template-parts/plugin-single.php |
Uses the filtered title for the plugin header. |
This pull request requires changes.
Review effort: Lite
|
@propsbot add dd32 |

Fixes https://meta.trac.wordpress.org/ticket/8111
Closed and disabled plugins show their slug instead of their name in the plugin header (https://meta.trac.wordpress.org/changeset/6469), but the
<title>,og:title, and the Contributors & Developers section (“Display Widgets” is open source software…) still use the plugin name.As suggested in the ticket, this moves the substitution into
the_titleandsingle_post_titlefilters in the theme, scoped to closed and disabled plugin posts. The filters are added ontemplate_redirect, so they only apply to front-end page loads and leave wp-admin and the REST API alone. The header now reads the filtered title like everything else.Testing
closedordisabled)./plugins/<slug>/.<h1 class="plugin-title">, the<title>, theog:titlemeta tag, and the “… is open source software” sentence in the Contributors & Developers section all show the slug.Before, on production: https://wordpress.org/plugins/display-widgets/ has
<h1>display-widgets</h1>but<title>Display Widgets – WordPress plugin | WordPress.org</title>,og:title="Display Widgets", and “Display Widgets” is open source software.Checked in wp-env with closed, disabled, and published plugin posts:
get_the_title(),the_title_attribute(),single_post_title(), andwp_get_document_title()return the slug for the first two and the name for the published one.🤖 Generated with Claude Code
Summary by CodeRabbit