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.


Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
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.


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

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;
	}