Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions admin/class-nginx-helper-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,9 +669,17 @@ public function set_future_post_option_on_future_status( $new_status, $old_statu

global $blog_id, $nginx_purger;

$exclude_post_types = array( 'nav_menu_item' );
$exclude_post_types = apply_filters( 'rt_nginx_helper_exclude_post_types', array( 'nav_menu_item' ) );

if ( in_array( $post->post_type, $exclude_post_types, true ) ) {
$post_type = $post->post_type;

if ( in_array( $post_type, $exclude_post_types, true ) ) {
if ( 'nav_menu_item' !== $post_type ) {
$nginx_purger->log('* * * * *');
$nginx_purger->log('* Post Type update - ' . $post_type . ' - purge trigger excluded...');
$nginx_purger->log('* Filter: -> rt_nginx_helper_exclude_post_types');
$nginx_purger->log('* * * * *');
}
return;
}

Expand All @@ -691,10 +699,10 @@ public function set_future_post_option_on_future_status( $new_status, $old_statu
if (
'future' === $new_status && $post && 'future' === $post->post_status &&
(
( 'post' === $post->post_type || 'page' === $post->post_type ) ||
( 'post' === $post_type || 'page' === $post_type ) ||
(
isset( $this->options['custom_post_types_recognized'] ) &&
in_array( $post->post_type, $this->options['custom_post_types_recognized'], true )
in_array( $post_type, $this->options['custom_post_types_recognized'], true )
)
)
) {
Expand Down
13 changes: 13 additions & 0 deletions admin/class-purger.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,19 @@ public function purge_post_on_comment_change( $newstatus, $oldstatus, $comment )

$_post_id = $comment->comment_post_ID;
$_comment_id = $comment->comment_ID;
$_post_type = get_post_type( $_post_id );

$exclude_post_types = apply_filters( 'rt_nginx_helper_comment_change_exclude_post_types', array() );

if ( in_array( $_post_type, $exclude_post_types, true ) ) {
if ( 'nav_menu_item' !== $_post_type ) {
$this->log( '* * * * *' );
$this->log('* Post Type comment update - ' . $_post_type . ' - purge trigger excluded...');
$this->log('* Filter: rt_nginx_helper_comment_change_exclude_post_types');
$this->log( '* * * * *' );
}
return;
}

$this->log( '* * * * *' );
$this->log( '* Blog :: ' . addslashes( get_bloginfo( 'name' ) ) . ' ( ' . $blog_id . ' ). ' );
Expand Down