WC_Notes_Run_Db_Update::note_up_to_date()private staticWC 1.0

Check whether the note is up to date for a fresh display.

The check tests if

  • actions are set up for the first 'Update database' notice, and
  • URL for note's action is equal to the given URL (to check for potential nonce update).

Метод класса: WC_Notes_Run_Db_Update{}

Хуков нет.

Возвращает

true|false.

Использование

$result = WC_Notes_Run_Db_Update::note_up_to_date( $note, $update_url, $current_actions );
$note(Note) (обязательный)
Note to check.
$update_url(строка) (обязательный)
URL to check the note against.
$current_actions (обязательный)
-

Код WC_Notes_Run_Db_Update::note_up_to_date() WC 8.7.0

private static function note_up_to_date( $note, $update_url, $current_actions ) {
	$actions = $note->get_actions();
	return count( $current_actions ) === count( array_intersect( wp_list_pluck( $actions, 'name' ), $current_actions ) )
		&& in_array( $update_url, wp_list_pluck( $actions, 'query' ), true );
}