Skip to content

Don't run the Title Generation Feature on attachments#1004

Merged
iamdharmesh merged 1 commit intodevelopfrom
fix/995
Sep 11, 2025
Merged

Don't run the Title Generation Feature on attachments#1004
iamdharmesh merged 1 commit intodevelopfrom
fix/995

Conversation

@dkotter
Copy link
Collaborator

@dkotter dkotter commented Sep 10, 2025

Description of the Change

Right now the Generate Titles button will show if you land on the attachment edit screen. At the moment, clicking the button won't work as expected so this PR removes that from showing if the post type is attachment. Also does some minor cleanup to the code to avoid nested conditionals.

We could look at adding a new setting to the Title Generation Feature to allow someone to choose which post types should work, similar to a few of our other Features but wanted a quicker fix for now.

Closes #995

How to test the Change

  1. Enable the Title Generation Feature
  2. Go to the edit screen for an attachment and ensure the Generate Titles button no longer shows
  3. Enable the Classic Editor plugin
  4. Edit a post and ensure the button shows and works

Changelog Entry

Fixed - Remove the Generate Titles button from attachments

Credits

Props @dkotter

Checklist:

@dkotter dkotter added this to the 3.7.0 milestone Sep 10, 2025
@dkotter dkotter self-assigned this Sep 10, 2025
@dkotter dkotter requested review from a team and jeffpaul as code owners September 10, 2025 18:55
@github-actions github-actions bot added the needs:code-review This requires code review. label Sep 10, 2025
@dkotter dkotter requested review from iamdharmesh and removed request for a team and jeffpaul September 10, 2025 19:23
Copy link
Member

@iamdharmesh iamdharmesh left a comment

Choose a reason for hiding this comment

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

Looks good and tests well. Thanks for fixing this @dkotter

@iamdharmesh iamdharmesh merged commit 404b3b3 into develop Sep 11, 2025
19 checks passed
@iamdharmesh iamdharmesh deleted the fix/995 branch September 11, 2025 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs:code-review This requires code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove the "Generate titles" button from attachments

2 participants