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_Student::insert_incompletion_postmeta( int $object_id, string $trigger = 'unspecified' )

Add student postmeta data for incompletion of a lesson, section, course or track An “_is_complete” value of “no” is inserted into postmeta


Parameters Parameters

$object_id

(int) (Required) WP Post ID of the lesson, section, course or track

$trigger

(string) (Optional) String describing the reason for mark incompletion

Default value: 'unspecified'


Top ↑

Return Return

(boolean)


Top ↑

Source Source

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

	 * @param  int    $object_id    WP Post ID of the lesson, section, course or track
	 * @param  string $trigger      String describing the reason for mark completion
	 * @return bool
	 * @since    3.3.1
	 * @version  3.21.0
	 */
	private function insert_completion_postmeta( $object_id, $trigger = 'unspecified' ) {

		// Add info to the user postmeta table.
		$user_metadatas = array(
			'_is_complete'        => 'yes',
			'_completion_trigger' => $trigger,
		);

		$update = llms_bulk_update_user_postmeta( $this->get_id(), $object_id, $user_metadatas, false );

		// Returns an array with errored keys or true on success.
		return is_array( $update ) ? false : true;

	}

	/**
	 * Add student postmeta data for incompletion of a lesson, section, course or track
	 * An "_is_complete" value of "no" is inserted into postmeta
	 *
	 * @param    int    $object_id    WP Post ID of the lesson, section, course or track
	 * @param    string $trigger      String describing the reason for mark incompletion
	 * @return   boolean
	 * @since    3.5.0
	 * @version  3.24.0
	 */
	private function insert_incompletion_postmeta( $object_id, $trigger = 'unspecified' ) {

		global $wpdb;

		// Add '_is_complete' to the user postmeta table for object.
		$user_metadatas = array(
			'_is_complete'        => 'no',
			'_completion_trigger' => $trigger,
		);

		foreach ( $user_metadatas as $key => $value ) {

			/**
			 * It's too difficult to keep track of multiple postmetas for each lesson incomplete
			 * Instead, I'm just replacing the old '_is_complete' value with 'no'
			 *


Top ↑

Changelog Changelog

Changelog
Version Description
3.5.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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