Skip to content

Commit

Permalink
fix(notifications): show new tests added notification if there are po…
Browse files Browse the repository at this point in the history
…st ids
  • Loading branch information
harunbleech committed Dec 7, 2023
1 parent cf967a0 commit afe1a30
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions includes/features/class-tests-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -428,11 +428,13 @@ public function render_notification_new_test_added() {
public function render_notification_new_tests_added() {
// phpcs:ignore WordPress.Security.NonceVerification.Recommended -- It should be ok here.
$post_ids = isset( $_GET['post_ids'] ) ? array_map( 'intval', $_GET['post_ids'] ) : false;
Admin_Notices::render_notification( 'new_tests_added', false, [
'page_titles' => implode( ', ', array_reverse( array_map( function( $post_id ) {
return get_the_title( $post_id );
}, $post_ids ) ) ),
]);
if ( $post_ids ) {
Admin_Notices::render_notification( 'new_tests_added', false, [
'page_titles' => implode( ', ', array_reverse( array_map( function( $post_id ) {
return get_the_title( $post_id );
}, $post_ids ) ) ),
]);
}
}

/**
Expand Down

0 comments on commit afe1a30

Please sign in to comment.