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
- $raw
-
(array) (Required) Array of raw data.
- $obj
-
(LLMS_Post_Model) (Required) The LLMS Post Object generated from the raw data.
Return Return
(int|false) Raw id when present or false if no raw id was found.
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'];
}
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
| Version | Description |
|---|---|
| 3.3.0 | Introduced. |