WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана

Automattic\WooCommerce\Admin\Notes

WooSubscriptionsNotes::prune_inactive_subscription_notes() public WC 1.0

Removes notes for product_ids no longer active on this site.

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

Хуков нет.

Возвращает

null. Ничего.

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

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

Код WooSubscriptionsNotes::prune_inactive_subscription_notes() WC 5.4.1

<?php
public function prune_inactive_subscription_notes() {
	$active_product_ids = $this->get_subscription_active_product_ids();

	$data_store = \WC_Data_Store::load( 'admin-note' );
	$note_ids   = $data_store->get_notes_with_name( self::SUBSCRIPTION_NOTE_NAME );

	foreach ( (array) $note_ids as $note_id ) {
		$note       = Notes::get_note( $note_id );
		$product_id = $this->get_product_id_from_subscription_note( $note );
		if ( ! empty( $product_id ) ) {
			if ( ! in_array( $product_id, $active_product_ids, true ) ) {
				$note->delete();
			}
		}
	}
}