comment_on_draft

comment_on_draft

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action

See hook in core

Displaying hooks found in version: wordpress-6.7.1

do_action('comment_on_draft') is found 1 times:

  • /wp-includes/comment.php line 3599
    		 * @since 1.5.1
    		 *
    		 * @param int $comment_post_id Post ID.
    		 */
    		do_action( 'comment_on_draft', $comment_post_id );
    
    		if ( current_user_can( 'read_post', $comment_post_id ) ) {
    			return new WP_Error( 'comment_on_draft', __( 'Sorry, comments are not allowed for this item.' ), 403 );
    		} else {
    			return new WP_Error( 'comment_on_draft' );
    		}