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_Generator::create_access_plan( array $raw, int $course_id, int $fallback_author_id = null )

Create a new access plan


Parameters Parameters

$raw

(array) (Required) Raw Access Plan Data

$course_id

(int) (Required) WP Post ID of a LLMS Course to assign the access plan to

$fallback_author_id

(int) (Optional) WP User ID to use for the access plan author if no author is supplied in the raw data

Default value: null


Top ↑

Return Return

(int)


Top ↑

Source Source

File: includes/class.llms.generator.php

	 * @since 3.36.3
	 *
	 * @param string $generator Generator name.
	 * @return bool
	 */
	protected function is_generator_valid( $generator ) {

		return in_array( $generator, array_keys( $this->get_generators() ), true );

	}

	/**
	 * Record the generation of an object
	 *
	 * @since 4.7.0
	 *
	 * @param LLMS_Post_Model|array|WP_User $object Created object or array.
	 * @return void
	 */
	public function object_created( $object ) {

		switch ( current_action() ) {

			case 'llms_generator_new_access_plan':
			case 'llms_generator_new_course':
			case 'llms_generator_new_section':
			case 'llms_generator_new_lesson':
			case 'llms_generator_new_quiz':
			case 'llms_generator_new_question':
				$this->record_generation( $object->get( 'id' ), $object->get( 'type' ) );
				break;

			case 'llms_generator_new_user':
				$this->record_generation( $object, 'user' );
				break;

			case 'llms_generator_new_term':
				$this->record_generation( $object['term_id'], 'term' );
				break;


Top ↑

Changelog Changelog

Changelog
Version Description
4.3.3 Use an empty string in favor of null for an empty post_content field.
3.7.3 Unknown.
3.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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