LLMS_Abstract_Generator_Posts::store_temp_id( array $raw, LLMS_Post_Model $obj )

Accepts a raw object, finds the raw id and stores it

Parameters Parameters


(array) (Required) Array of raw data.


(LLMS_Post_Model) (Required) The LLMS Post Object generated from the raw data.

Top ↑

Return Return

(int|false) Raw id when present or false if no raw id was found.

Top ↑

Source Source

File: includes/abstracts/llms-abstract-generator-posts.php

	protected function store_temp_id( $raw, $obj ) {

		if ( empty( $raw['id'] ) ) {
			return false;

		// Ensure the object post type array exists.
		if ( ! isset( $this->tempids[ $obj->get( 'type' ) ] ) ) {
			$this->tempids[ $obj->get( 'type' ) ] = array();

		// Store the id on the meta table.
		$obj->set( 'generated_from_id', $raw['id'] );

		// Store it in the object for prereq handling later.
		$this->tempids[ $obj->get( 'type' ) ][ $raw['id'] ] = $obj->get( 'id' );

		return $raw['id'];


Top ↑

Changelog Changelog

Version Description
3.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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