WordPress at Your Fingertips
function is not described

WC_Notes_Refund_Returns::possibly_add_note() public WC 1.0

Maybe add a note to the inbox.

{} It's a method of the class: WC_Notes_Refund_Returns{}

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Notes_Refund_Returns::possibly_add_note( $page_id );
$page_id(int) (required)
The ID of the page.

Code of WC_Notes_Refund_Returns::possibly_add_note() WC 5.9.0

public static function possibly_add_note( $page_id ) {
	$data_store = \WC_Data_Store::load( 'admin-note' );

	// Do we already have this note?
	$note_id = $data_store->get_notes_with_name( self::NOTE_NAME );

	if ( ! empty( $note_id ) ) {
		$note = new Note( $note_id );

		if ( false !== $note || $note::E_WC_ADMIN_NOTE_ACTIONED === $note->get_status() ) {
			// note actioned -> don't show it.
			return;
		}
	}

	// Add note.
	$note = self::get_note( $page_id );
	$note->save();
	delete_option( 'woocommerce_refund_returns_page_created' );
}