{"action":"created","comment":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments/69341227","id":69341227,"diff_hunk":"@@ -252,6 +255,98 @@ function queue_post_purge( $post_id ) {\n \t\t */\n \t\t$this->purge_urls = apply_filters( 'wpcom_vip_cache_purge_urls', $this->purge_urls, $post_id );\n \t}\n+\n+\t/**\n+\t * Purge the cache for some terms\n+\t *\n+\t * Hooks the `clean_term_cache` action\n+\t *\n+\t * We do not respect requests to clear caches for the entire taxonomy,\n+\t * as this would be potentially hundreds or thousands of PURGE requests.\n+\t *\n+\t * @param array  $ids            An array of term IDs.\n+\t * @param string $taxonomy       Taxonomy slug.\n+\t * @param bool   $clean_taxonomy Whether or not to clean taxonomy-wide caches\n+\t */\n+\tfunction queue_term_purge( $ids, $taxonomy ) {\n+\t\t$get_term_args = array(\n+\t\t\t'taxonomy'    => $taxonomy,\n+\t\t\t'include'     => $ids,\n+\t\t\t'hide_empty'  => false,\n+\t\t);\n+\t\t$terms = get_terms( $get_term_args );\n+\t\tif ( is_wp_error( $terms ) ) {\n+\t\t\treturn;\n+\t\t}\n+\t\tforeach ( $terms as $term ) {\n+\t\t\tif ( ! term_exists( $term->term_id, $taxonomy ) ) {\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t$this->queue_purge_urls_for_term( $term );\n+\t\t}\n+\t}\n+\n+\t/**\n+\t * Queue all URLs to be purged for a given term\n+\t *\n+\t * @param object $term A WP term object\n+\t */\n+\tfunction queue_purge_urls_for_term( $term ) {\n+\n+\t\t/**\n+\t\t * Allows you to customise the URL suffix used to specify a page for\n+\t\t * paged term archives.\n+\t\t *\n+\t\t * Developers should hook this filter to provide a different page\n+\t\t * endpoint if they have custom or translated rewrite rules for\n+\t\t * paging in term archives:\n+\t\t *\n+\t\t * Standard:     example.com/category/news/page/2\n+\t\t * Non-standard: example.com/category/news/p/2\n+\t\t *\n+\t\t * The string should be formatted as for `sprintf`, with a `%d` in place\n+\t\t * of the page number.\n+\t\t *\n+\t\t * @param string sprintf formatted string, including `%d`\n+\t\t * }\n+\t\t */\n+\t\t$paging_endpoint = apply_filters( 'wpcom_vip_cache_purge_urls_paging_endpoint', $GLOBALS['wp_rewrite']->pagination_base . '/%d/' );\n+\n+\t\t/**\n+\t\t * The maximum page to purge from each term archive when a post associated with\n+\t\t * that term is published.\n+\t\t *\n+\t\t * e.g. if the value is 3, the following pagination URLs will be purged for the\n+\t\t * news category archive:\n+\t\t *\n+\t\t * example.com/category/news/\n+\t\t * example.com/category/news/page/2\n+\t\t * example.com/category/news/page/3\n+\t\t *\n+\t\t * @param int The maximum page to purge from each term archive\n+\t\t * }\n+\t\t */\n+\t\t$max_pages = apply_filters( 'wpcom_vip_cache_purge_urls_max_pages', 5 );","path":"cache-manager.php","position":134,"original_position":134,"commit_id":"97280723c8596afacd0d33d302fbf4711e9e2dbb","original_commit_id":"97280723c8596afacd0d33d302fbf4711e9e2dbb","user":{"login":"ethitter","id":321503,"avatar_url":"https://avatars.githubusercontent.com/u/321503?v=3","gravatar_id":"","url":"https://api.github.com/users/ethitter","html_url":"https://github.com/ethitter","followers_url":"https://api.github.com/users/ethitter/followers","following_url":"https://api.github.com/users/ethitter/following{/other_user}","gists_url":"https://api.github.com/users/ethitter/gists{/gist_id}","starred_url":"https://api.github.com/users/ethitter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ethitter/subscriptions","organizations_url":"https://api.github.com/users/ethitter/orgs","repos_url":"https://api.github.com/users/ethitter/repos","events_url":"https://api.github.com/users/ethitter/events{/privacy}","received_events_url":"https://api.github.com/users/ethitter/received_events","type":"User","site_admin":false},"body":"This should receive the same range restriction we apply to post-type archives.","created_at":"2016-07-01T18:47:35Z","updated_at":"2016-07-01T18:47:36Z","html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/232#discussion_r69341227","pull_request_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232","_links":{"self":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments/69341227"},"html":{"href":"https://github.com/Automattic/vip-go-mu-plugins/pull/232#discussion_r69341227"},"pull_request":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232"}}},"pull_request":{"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232","id":76006764,"html_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/232","diff_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/232.diff","patch_url":"https://github.com/Automattic/vip-go-mu-plugins/pull/232.patch","issue_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/232","number":232,"state":"open","locked":false,"title":"Purge removed term archives","user":{"login":"simonwheatley","id":233434,"avatar_url":"https://avatars.githubusercontent.com/u/233434?v=3","gravatar_id":"","url":"https://api.github.com/users/simonwheatley","html_url":"https://github.com/simonwheatley","followers_url":"https://api.github.com/users/simonwheatley/followers","following_url":"https://api.github.com/users/simonwheatley/following{/other_user}","gists_url":"https://api.github.com/users/simonwheatley/gists{/gist_id}","starred_url":"https://api.github.com/users/simonwheatley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonwheatley/subscriptions","organizations_url":"https://api.github.com/users/simonwheatley/orgs","repos_url":"https://api.github.com/users/simonwheatley/repos","events_url":"https://api.github.com/users/simonwheatley/events{/privacy}","received_events_url":"https://api.github.com/users/simonwheatley/received_events","type":"User","site_admin":false},"body":"**Should be merged after #231**\r\n\r\nHook `clean_term_cache` and purge URLs associated with the terms.","created_at":"2016-07-01T16:41:59Z","updated_at":"2016-07-01T18:47:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5b0eb8db14964be0377817b9ba73e2eb808334c9","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232/commits","review_comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232/comments","review_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/232/comments","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/97280723c8596afacd0d33d302fbf4711e9e2dbb","head":{"label":"Automattic:231-purge-removed-term-archives","ref":"231-purge-removed-term-archives","sha":"97280723c8596afacd0d33d302fbf4711e9e2dbb","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":32939693,"name":"vip-go-mu-plugins","full_name":"Automattic/vip-go-mu-plugins","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/vip-go-mu-plugins","description":"The 'must use' plugins on the VIP Go platform.","fork":false,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins","forks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/forks","keys_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/teams","hooks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/hooks","issue_events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/events","assignees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/tags","blobs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/languages","stargazers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/stargazers","contributors_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contributors","subscribers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscribers","subscription_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscription","commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/merges","archive_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/downloads","issues_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/deployments","created_at":"2015-03-26T16:42:46Z","updated_at":"2016-06-07T14:17:34Z","pushed_at":"2016-07-01T17:52:49Z","git_url":"git://github.com/Automattic/vip-go-mu-plugins.git","ssh_url":"git@github.com:Automattic/vip-go-mu-plugins.git","clone_url":"https://github.com/Automattic/vip-go-mu-plugins.git","svn_url":"https://github.com/Automattic/vip-go-mu-plugins","homepage":"","size":31791,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":41,"forks":4,"open_issues":41,"watchers":3,"default_branch":"master"}},"base":{"label":"Automattic:master","ref":"master","sha":"9f42e11c9a7e13d243befdd9a3d8c8de99be7658","user":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"repo":{"id":32939693,"name":"vip-go-mu-plugins","full_name":"Automattic/vip-go-mu-plugins","owner":{"login":"Automattic","id":887802,"avatar_url":"https://avatars.githubusercontent.com/u/887802?v=3","gravatar_id":"","url":"https://api.github.com/users/Automattic","html_url":"https://github.com/Automattic","followers_url":"https://api.github.com/users/Automattic/followers","following_url":"https://api.github.com/users/Automattic/following{/other_user}","gists_url":"https://api.github.com/users/Automattic/gists{/gist_id}","starred_url":"https://api.github.com/users/Automattic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Automattic/subscriptions","organizations_url":"https://api.github.com/users/Automattic/orgs","repos_url":"https://api.github.com/users/Automattic/repos","events_url":"https://api.github.com/users/Automattic/events{/privacy}","received_events_url":"https://api.github.com/users/Automattic/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Automattic/vip-go-mu-plugins","description":"The 'must use' plugins on the VIP Go platform.","fork":false,"url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins","forks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/forks","keys_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/teams","hooks_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/hooks","issue_events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/events","assignees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/tags","blobs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/languages","stargazers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/stargazers","contributors_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contributors","subscribers_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscribers","subscription_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/subscription","commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/merges","archive_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/downloads","issues_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/labels{/name}","releases_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/deployments","created_at":"2015-03-26T16:42:46Z","updated_at":"2016-06-07T14:17:34Z","pushed_at":"2016-07-01T17:52:49Z","git_url":"git://github.com/Automattic/vip-go-mu-plugins.git","ssh_url":"git@github.com:Automattic/vip-go-mu-plugins.git","clone_url":"https://github.com/Automattic/vip-go-mu-plugins.git","svn_url":"https://github.com/Automattic/vip-go-mu-plugins","homepage":"","size":31791,"stargazers_count":3,"watchers_count":3,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":4,"mirror_url":null,"open_issues_count":41,"forks":4,"open_issues":41,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232"},"html":{"href":"https://github.com/Automattic/vip-go-mu-plugins/pull/232"},"issue":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/232"},"comments":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/issues/232/comments"},"review_comments":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232/comments"},"review_comment":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/pulls/232/commits"},"statuses":{"href":"https://api.github.com/repos/Automattic/vip-go-mu-plugins/statuses/97280723c8596afacd0d33d302fbf4711e9e2dbb"}}}}
{"actor":{"display_login":"ethitter"}}