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.

LD_LESSONDONE::lesson_matches( int $field_lesson_id, int $action_hook_lesson_id )

Determine if the selected lesson in the trigger matches the one sent by the action hook.


Parameters Parameters

$field_lesson_id

(Required) The lesson ID from the field.

$action_hook_lesson_id

(Required) The lesson ID sent from 'learndash_lesson_completed'.


Top ↑

Return Return

(bool) True if lesson matches. Otherwise, false.


Source Source

File: src/integrations/learndash/triggers/ld-lessondone.php

	private function lesson_matches( $field_lesson_id = 0, $action_hook_lesson_id = 0 ) {
		// Determine if selected lesson mataches received lesson ID.
		$lesson_is_any  = intval( $field_lesson_id ) === -1;
		$lesson_matches = intval( $field_lesson_id ) === absint( $action_hook_lesson_id ) || $lesson_is_any;
		return $lesson_matches;
	}