LLMS_Notification_View_Certificate_Earned::set_merge_data( string $code )

Replace merge codes with actual values.


Parameters Parameters

$code

(string) (Required) The merge code to get merged data for.


Top ↑

Return Return

(string) The merged string or the original code for invalid merge codes.


Top ↑

Source Source

File: includes/notifications/views/class.llms.notification.view.certificate.earned.php

	protected function set_merge_data( $code ) {

		if ( in_array( $code, array_keys( $this->set_merge_codes() ), true ) ) {
			$method = 'set_merge_data_' . strtolower( str_replace( array( '{{', '}}' ), '', $code ) );
			$code   = method_exists( $this, $method ) ? $this->$method( new LLMS_User_Certificate( $this->notification->post_id ) ) : $code;
		}

		return $code;

	}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Refactor to give each merge code it's own method.
3.8.0
3.16.6 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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