Created
February 22, 2022 14:13
-
-
Save grantalltodavid/a106c6b08f21d93afef5be16babbb886 to your computer and use it in GitHub Desktop.
Sliced Invoices: disable comments for all quotes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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