Only update the status of a note if the triggered action is non-empty.

This commit is contained in:
Jeff Stieler 2019-06-11 12:38:49 -06:00
parent 22cdec7e57
commit 4ae938c99d
1 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,10 @@ class WC_Admin_REST_Admin_Note_Action_Controller extends WC_Admin_REST_Admin_Not
do_action( 'woocommerce_admin_note_action_' . $triggered_action->name, $note ); do_action( 'woocommerce_admin_note_action_' . $triggered_action->name, $note );
// Update the note with the status for this action. // Update the note with the status for this action.
$note->set_status( $triggered_action->status ); if ( ! empty( $triggered_action->status ) ) {
$note->set_status( $triggered_action->status );
}
$note->save(); $note->save();
$data = $note->get_data(); $data = $note->get_data();