Skip to content

Added support for modifying the post authors #77

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

oppiansteve
Copy link
Contributor

@oppiansteve oppiansteve commented Nov 13, 2019

For example, if you have most posts created by a single author you probably don’t want every post purged when any one of them changes, so you could use:

add_filter('purgely_post_authors', function ($authors, $post) {
    return [];
}, 10, 2);

It might seem a bit odd that we changed authors support into multiple, but we thought it was more useful as we do currently support multiple authors for our posts, but happy to switch it to only supporting a single author if you prefer.

Also, it is a little different from purgely_taxonomy_keys as it seemed more sensible and flexible to include the post in the filter call.
In fact, I don't think it would hurt adding the post to the purgely_taxonomy_keys filter too, but we don't need that ourselves.

For example, if you have most posts created by a single ‘automation’ author you probably don’t want every post purged when any one of them changes, so you could use:

```
add_filter('purgely_post_authors', function ($authors, $post) {
    return [];
}, 10, 2);
```
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.

1 participant