AnsPress_Hooks::new_comment_approve( integer $comment_id, integer|false $approved )

Description #

Used to create an action when comment publishes.

Parameters #

  • $comment_id
    integer (Required) Comment ID.
  • $approved
    integer | false (Required) 1 if comment is approved else false.

Changelog #

VersionDescription
unknownunknown
4.1.0Introduced.

Source #

File: includes/hooks.php

	public static function new_comment_approve( $comment_id, $approved ) {
		if ( 1 === $approved ) {
			$comment = get_comment( $comment_id );

			if ( 'anspress' === $comment->comment_type ) {
				/**
				 * Action is triggered when a anspress comment is published.
				 *
				 * @param object $comment Comment object.
				 * @since unknown
				 */
				do_action( 'ap_publish_comment', $comment );
			}
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment