Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove media from language processing settings #245

Merged
merged 5 commits into from
Oct 26, 2020

Conversation

dkotter
Copy link
Collaborator

@dkotter dkotter commented Oct 22, 2020

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 and post_content, which attachments should have a post_title and some may have post_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:

  • I have read the CONTRIBUTING document.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests passed.

Applicable Issues

#242

…o show in our language processing settings. Remove attachments from this list by default
@dkotter dkotter self-assigned this Oct 22, 2020
@ShahAaron
Copy link

@dkotter this needs looks good, it just needs the test removed from NaturalLanguageProcessing.php as media ( attachment ) has been removed as an option.

@dkotter
Copy link
Collaborator Author

dkotter commented Oct 23, 2020

@dkotter this needs looks good, it just needs the test removed from NaturalLanguageProcessing.php as media ( attachment ) has been removed as an option.

Thanks for catching that! This has been fixed

@jeffpaul jeffpaul added this to the 1.6.0 milestone Oct 23, 2020
@jeffpaul jeffpaul added the type:enhancement New feature or request. label Oct 23, 2020
@jeffpaul jeffpaul linked an issue Oct 23, 2020 that may be closed by this pull request
@jeffpaul jeffpaul merged commit 578c3d9 into develop Oct 26, 2020
@jeffpaul jeffpaul deleted the feature/remove-media-option branch October 26, 2020 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement New feature or request.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Media as option to select in Language Processing
4 participants