Skip to content

Commit

Permalink
Auto-purge XML feeds for Custom Post Type Archive View
Browse files Browse the repository at this point in the history
See #280
  • Loading branch information
raamdev committed Sep 19, 2014
1 parent 7dbf2d5 commit be744da
Showing 1 changed file with 7 additions and 17 deletions.
24 changes: 7 additions & 17 deletions quick-cache/quick-cache.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -1317,23 +1317,13 @@ public function auto_purge_xml_feeds_cache($type, $post_id = 0)
if(!$post_id) break; // Nothing to do here.
if(!($post = get_post($post_id))) break;

$post_type = get_post_type($post_id);
$custom_post_type_archive_link = get_post_type_archive_link($post_type);

/*
* @TODO @jaswsinc We don't have a 'get_post_type_feed_link()` function available
* so we'll need to write our own here to build the proper Custom Post Type Archive
* feed links, which should be something like get_post_type_archive_link() . '/rdf/' etc.
* however, looking at get_feed_link, I see that that routine also takes into account
* unfriendly permalink structures, so it's probably not as simple as appending '/rdf/'
* to the Custom Post Type Archive link.
*
$feed_cache_path_regexs[] = $build_cache_path_regex(get_feed_link($default_feed));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_feed_link('rdf'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_feed_link('rss'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_feed_link('rss2'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_feed_link('atom'));
*/
$custom_post_type_archive_link = get_post_type_archive_link($post->post_type);

$feed_cache_path_regexs[] = $build_cache_path_regex(get_post_type_archive_feed_link($post->post_type, $default_feed));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_post_type_archive_feed_link($post->post_type, 'rdf'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_post_type_archive_feed_link($post->post_type, 'rss'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_post_type_archive_feed_link($post->post_type, 'rss2'));
$feed_cache_path_regexs[] = $build_cache_path_regex(get_post_type_archive_feed_link($post->post_type, 'atom'));

// It is not necessary to cover query string variations for these when `$seo_friendly_permalinks = TRUE`,
// because `redirect_canonical()` will force SEO-friendly links in the end anyway.
Expand Down

0 comments on commit be744da

Please sign in to comment.