Skip to content

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