Skip to content

Instantly share code, notes, and snippets.

@grantalltodavid
Created February 22, 2022 14:13
Show Gist options
  • Save grantalltodavid/a106c6b08f21d93afef5be16babbb886 to your computer and use it in GitHub Desktop.
Save grantalltodavid/a106c6b08f21d93afef5be16babbb886 to your computer and use it in GitHub Desktop.
Sliced Invoices: disable comments for all quotes
add_filter( 'comments_open', 'si20220222_disable_comments_for_all_quotes', 10, 2 );
function si20220222_disable_comments_for_all_quotes( $open, $post_id = null ) {
$_post = get_post( $post_id );
if ( $_post && ( $_post->post_type === 'sliced_quote' ) ) {
$open = false;
}
return $open;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment