Remove media from language processing settings #245
Merged
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.
Description of the Change
In the Language Processing settings, we have a section to select what post types you want processed. This pulls all public post types, which will include the Attachment post type. While in theory you could run language processing on attachments (processing takes into account the
post_title
andpost_content
, which attachments should have apost_title
and some may havepost_content
) attachments fire different hooks than other post types, which we aren't currently accounting for. So if you select the Media option in settings, it won't actually do anything.This PR adds a new helper function to build up the list of post types we want in our Language Processing settings. This helper function runs the results through a new filter, so these results can be filtered if needed. This new function also removes attachments from that list, so we no longer show that as an option in our settings list.
Alternate Designs
None
Benefits
This removes a setting that currently won't actually do anything, potentially causing user confusion. Also introduces a new filter, allowing more granular control over the options shown.
Possible Drawbacks
None
Verification Process
Go to the Language Processing settings and ensure there are still post type options shown and Media isn't shown anymore.
Checklist:
Applicable Issues
#242