How to add custom columns to the Queue table

You can do it with the standard WordPress filter and action for adding the custom column to Custom Post Type table, but there’s more efficient way implemented in the extension. All you need is notification_review_queue_add_table_column function.

Below you’ll find some examples.

Trigger name column

notification_review_queue_add_table_column( __( 'Trigger', 'textdomain' ), function( $post_id, $notifications, $trigger ) {
	echo $trigger->get_name();
} );

Email subject column

notification_review_queue_add_table_column( __( 'Email subject', 'textdomain' ), function( $post_id, $notifications, $trigger ) {
	
	foreach ( $notifications as $key => $notification ) {
		if ( $notification->get_slug() == 'email' ) {
			echo $notification->get_field_value( 'subject' );
			return;
		}
	}

} );

Email recipients column

notification_review_queue_add_table_column( __( 'Email recipients', 'textdomain' ), function( $post_id, $notifications, $trigger ) {
	
	foreach ( $notifications as $key => $notification ) {
		if ( $notification->get_slug() == 'email' ) {
			foreach ( $notification->get_field_value( 'parsed_recipients' ) as $recipient ) {
				echo $recipient['email'] . '<br>';
			}
			return;
		}
	}

} );