LLMS_Notification::get( string $key,  $skip_cache = false )

Get notification properties


Parameters Parameters

$key

(string) (Required) key to retrieve


Top ↑

Return Return

(mixed)


Top ↑

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.

	}

Top ↑

Changelog Changelog

Changelog
Version Description
3.8.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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