Fix comment form showing despite comments being off
This commit is contained in:
parent
b01085383e
commit
08cdd52433
@ -56,7 +56,7 @@ $logout_url = fictioneer_get_logout_url( get_permalink() );
|
||||
fictioneer_comment_header( $comments_count );
|
||||
|
||||
// Comment form
|
||||
if ( ! fictioneer_is_commenting_disabled() ) {
|
||||
if ( ! fictioneer_is_commenting_disabled( $post_id ) ) {
|
||||
if ( get_option( 'fictioneer_enable_ajax_comment_form' ) ) {
|
||||
fictioneer_comments_ajax_form_skeleton();
|
||||
} else {
|
||||
|
@ -1499,6 +1499,9 @@ if ( ! function_exists( 'fictioneer_is_commenting_disabled' ) ) {
|
||||
*/
|
||||
|
||||
function fictioneer_is_commenting_disabled( $post_id = null ) {
|
||||
// Setup
|
||||
$post_id = $post_id ?? get_the_ID();
|
||||
|
||||
// Return immediately if...
|
||||
if (
|
||||
get_option( 'fictioneer_disable_commenting' ) ||
|
||||
|
@ -171,7 +171,7 @@ function fictioneer_output_modals( $args ) {
|
||||
! empty( $args['post_id'] ) &&
|
||||
! post_password_required() &&
|
||||
comments_open() &&
|
||||
! fictioneer_is_commenting_disabled()
|
||||
! fictioneer_is_commenting_disabled( $args['post_id'] )
|
||||
) {
|
||||
?><input id="modal-bbcodes-toggle" data-target="bbcodes-modal" type="checkbox" tabindex="-1" class="modal-toggle" autocomplete="off" hidden><?php
|
||||
get_template_part( 'partials/_modal-bbcodes' );
|
||||
|
Loading…
x
Reference in New Issue
Block a user