Skip to content

Commit 17547fc

Browse files
authored
Merge pull request #268 from rtCamp/fix/issue-40-purge-date-archive-for-cpt
[Issue 40] Fix: purge date archives for all public post types
2 parents 2265fc5 + 0beb70e commit 17547fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

admin/class-purger.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@ private function _purge_by_options( $post_id, $blog_id, $_purge_page, $_purge_ar
263263

264264
}
265265

266-
if ( 'post' === $_post_type ) {
266+
$post_types = get_post_types( array( 'public' => true ) );
267+
268+
if ( in_array( $_post_type, $post_types, true ) ) {
267269

268270
$this->log( 'Purging date' );
269271

0 commit comments

Comments
 (0)