LLMS_Generator::get_author_id_from_raw( array $raw, int $fallback_author_id = null )

Receives a raw array of course, plan, section, lesson, etc data and gets an author id falls back to optionally supplied fallback id falls back to current user id


Description Description


Parameters Parameters

$raw

(array) (Required) raw data

$fallback_author_id

(int) (Optional) WP User ID

Default value: null


Top ↑

Return Return

(int|WP_Error)


Top ↑

Source Source

File: includes/class.llms.generator.php

	public function get_author_id_from_raw( $raw, $fallback_author_id = null ) {

		// if author is set, get the author id
		if ( isset( $raw['author'] ) ) {
			$author_id = $this->get_author_id( $raw['author'] );
		}

		// fallback to current user
		if ( empty( $author_id ) ) {
			$author_id = ! empty( $fallback_author_id ) ? $fallback_author_id : get_current_user_id();
		}

		return $author_id;

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.30.2 Made publicly accessible.
3.3.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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