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_Abstract_Database_Store::create()
Create the item in the database
Return Return
(int|false) Record ID on success, false on error or when there's nothing to save.
Source Source
File: includes/abstracts/llms.abstract.database.store.php
private function create() { if ( ! $this->data ) { return false; } global $wpdb; $format = array_map( array( $this, 'get_column_format' ), array_keys( $this->data ) ); $res = $wpdb->insert( $this->get_table(), $this->data, $format ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery if ( 1 === $res ) { $this->id = $wpdb->insert_id; /** * Fires when a new database record is created. * * The dynamic portion of this hook, `$this->type`, refers to the record type. * * @since Unknown. * * @param int $id Record ID. * @param LLMS_Abstract_Database_Store $obj Instance of the record object. */ do_action( "llms_{$this->type}_created", $this->id, $this ); return $this->id; } return false; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
6.0.0 | Removed deprecated llms__created action hook. |
4.3.0 | Added deprecated hook call to llms__created action to preserve backwards compatibility. |
3.24.0 | Unknown. |
3.14.0 | Introduced. |