learndash_update_posts_comment_status

apply_filters( 'learndash_update_posts_comment_status',  boolean $update_comment_status,  string $post_type,  string $comment_status )

Filters whether to update comment status for any post type or not.


Description #


Parameters #

$update_comment_status

(boolean) Whether to Update comment status or not.

$post_type

(string) Post type slug.

$comment_status

(string) Status of comments.


Source #

File: includes/ld-misc-functions.php


Examples #

 <?php
/**
 * Example usage for learndash_update_posts_comment_status filter.
 */
add_filter(
	'learndash_update_posts_comment_status',
	function( $update_comment_status, $post_type, $comment_status ) {
		// May add any custom logic using $update_comment_status, $post_type, $comment_status.

		// Always return $update_comment_status.
		return $update_comment_status;
	},
	10,
	3
);