Skip to content

Plugin Directory: Show closed plugins by their slug everywhere on the front end - #1190

Open
obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/closed-plugin-title
Open

obenland wants to merge 1 commit into
WordPress:trunkfrom
obenland:fix/closed-plugin-title

Conversation

@obenland

@obenland obenland commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

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_title and single_post_title filters in the theme, scoped to closed and disabled plugin posts. The filters are added on template_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

  1. On a local Plugin Directory environment, close a plugin (or set a plugin post’s status to closed or disabled).
  2. Visit its page, e.g. /plugins/<slug>/.
  3. Check that the <h1 class="plugin-title">, the <title>, the og:title meta tag, and the “… is open source software” sentence in the Contributors & Developers section all show the slug.
  4. Check that a published plugin still shows its name in all of those places, and that the closed plugin still shows its name in wp-admin.

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(), and wp_get_document_title() return the slug for the first two and the name for the published one.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Closed or disabled plugin pages now display the plugin’s URL-friendly name as the title. Titles for other plugins remain unchanged. This keeps page titles consistent with the name used in the plugin’s web address when a plugin is no longer available.

… 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>
Copilot AI lite review requested due to automatic review settings November 6, 2026 04:56
@github-actions

github-actions Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

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:

Props obenland, dd32.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@coderabbitai

coderabbitai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The theme adds title filters for plugin posts with status closed or disabled. Those filters return the post slug. The single-plugin template now obtains its title through get_the_title().

Changes: Plugin titles

Layer / File(s) Summary
Register and apply plugin title filters
wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/functions.php, wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/template-parts/plugin-single.php
The theme registers filters for the_title and single_post_title. For plugin posts with status closed or disabled, the filters return the post slug; other posts retain the supplied title. The single-plugin template now uses get_the_title() for its title.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Bug fix

Merge Risk: Minimal · up to f689b

The change is ready to merge after normal checks.

Pre-merge checks: Passed 5

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: showing closed plugin slugs on the front end.
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 427e81d5-7a2f-44a8-ae3f-07888840e725
Commits

Reviewing files that changed from the base of the PR and between 4004d8e and f689b0a.

Files selected for processing: 2

  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/functions.php
  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins-2024/template-parts/plugin-single.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

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.

🟡 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_title and single_post_title filters 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

@obenland

obenland commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

@propsbot add dd32

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.

2 participants