Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.

WC_Notes_Run_Db_Update::note_up_to_date( AutomatticWooCommerceAdminNotesNote $note, string $update_url,  $current_actions )

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


Description Description

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).

Parameters Parameters

$note

(Required) Note to check.

$update_url

(Required) URL to check the note against.

(Required) string> $current_actions List of actions to check for.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/admin/notes/class-wc-notes-run-db-update.php

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

		return false;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.