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.

LLMS_Transaction::record_refund_note( string $note, float $amount, string $refund_id, string $method )

Records an order note associated with a refund.


Parameters Parameters

$note

(string) (Required) User-submitted refund note data to add to the order alongside the refund.

$amount

(float) (Required) The refund amount.

$refund_id

(string) (Required) The generated refund ID.

$method

(string) (Required) The refund processing method ID.


Top ↑

Return Return

(int) The WP_Comment ID of the recorded order note.


Top ↑

Source Source

File: includes/models/model.llms.transaction.php

	private function record_refund_note( $note, $amount, $refund_id, $method ) {

		/**
		 * Filters user-submitted transaction refund order note.
		 *
		 * @since Unknown.
		 *
		 * @param string           $note        The user-submitted order note text.
		 * @param LLMS_Transaction $transaction The transaction object.
		 * @param float            $amount      The refund amount.
		 * @param string           $method      The ID of the refund method.
		 */
		$orig_note = apply_filters( 'llms_transaction_refund_note', $note, $this, $amount, $method );

		$note = sprintf(
			// Translators: %1$s = The refund amount; %2$d the transaction ID; %3$s The refund method name; %4$s = the refund ID.
			__( 'Refunded %1$s for transaction #%2$d via %3$s [Refund ID: %4$s]', 'lifterlms' ),
			wp_strip_all_tags( llms_price( $amount ) ),
			$this->get( 'id' ),
			$this->get_refund_method_title( $method ),
			$refund_id
		);

		if ( $orig_note ) {
			$note .= "\r\n";
			$note .= __( 'Refund Notes: ', 'lifterlms' );
			$note .= "\r\n";
			$note .= $orig_note;
		}

		// Record the note.
		return $this->get_order()->add_note( $note, true );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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