Added function to retrieve filterable post statuses for classification. #310
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
Adds a filter to allow post statuses other than
publish
to be allowed to classify content.Benefits
Users will be able to save content in other post statuses - e.g.
draft
and this content will be classified.Possible Drawbacks
If
publish
is removed from the array, content will not be classified on publication.Verification Process
I ran the following code in a MU plugin to modify the post statuses:
The resulting data upon saving a draft post was:
Checklist:
Applicable Issues
#309
Changelog Entry
Added:
classifai_post_statuses
filter; allows post statuses for content classification to be changed as required (but would apply to all post types).Added:
classifai_post_statuses_for_post_type_or_id
filter; allows post statuses for content classification to be changed as required based on post type / post ID.