LLMS_Notification::get( string $key, $skip_cache = false )
Get notification properties
Parameters Parameters
- $key
-
(string) (Required) key to retrieve
Return Return
(mixed)
Source Source
File: includes/models/model.llms.notification.php
public function get( $key, $skip_cache = false ) { // Id will always be accessed from the object. if ( 'id' === $key ) { return $this->id; } // Return cached values if they exist. if ( ! is_null( $this->$key ) && ! $skip_cache ) { return $this->$key; } // get the value from the database. global $wpdb; // phpcs:ignore WordPress.DB.PreparedSQL.InterpolatedNotPrepared return $wpdb->get_var( $wpdb->prepare( "SELECT {$key} FROM {$this->get_table()} WHERE id = %d", $this->id ) ); // db call ok; no-cache ok. }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.8.0 | Introduced. |