Automattic\WooCommerce\Internal\Admin\Notes

WooSubscriptionsNotes::delete_any_note_for_product_id()publicWC 1.0

Deletes a note for a given product ID, if the note exists at all.

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

Хуков нет.

Возвращает

null. Ничего.

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

$WooSubscriptionsNotes = new WooSubscriptionsNotes();
$WooSubscriptionsNotes->delete_any_note_for_product_id( $product_id );
$product_id(int) (обязательный)
The product ID to search for.

Код WooSubscriptionsNotes::delete_any_note_for_product_id() WC 7.1.0

public function delete_any_note_for_product_id( $product_id ) {
	$product_id = intval( $product_id );

	$note = $this->find_note_for_product_id( $product_id );
	if ( $note ) {
		$note->delete();
	}
}