Automattic\WooCommerce\Internal\Admin\Notes

WooSubscriptionsNotes::check_connection()publicWC 1.0

Checks the connection. Adds a note (as necessary) if there is no connection.

Method of the class: WooSubscriptionsNotes{}

No Hooks.

Return

null. Nothing (null).

Usage

$WooSubscriptionsNotes = new WooSubscriptionsNotes();
$WooSubscriptionsNotes->check_connection();

WooSubscriptionsNotes::check_connection() code WC 8.6.1

public function check_connection() {
	if ( ! $this->is_connected() ) {
		$data_store = Notes::load_data_store();
		$note_ids   = $data_store->get_notes_with_name( self::CONNECTION_NOTE_NAME );
		if ( ! empty( $note_ids ) ) {
			// We already have a connection note. Exit early.
			return;
		}

		$this->remove_notes();
		$this->add_no_connection_note();
	}
}