Noptin_Subscriber::get( string $key,  $single = true )

Retrieve the value of a property or meta key.


Parameters Parameters

$key

(string) (Required) Property


Top ↑

Return Return

(mixed)


Top ↑

Source Source

File: includes/class-noptin-subscriber.php

	public function get( $key, $single = true ) {

		// Abort early if the subscriber does not exist.
		if ( ! $this->exists() ) {
			return null;
		}

		$value = null;

		if ( strtolower( $key ) === 'id' ) {
			$key = 'id';
		}

		if ( strtolower( $key ) === 'last_name' ) {
			$key = 'second_name';
		}

		if ( isset( $this->data->$key ) ) {
			$value = $this->data->$key;
		} else {
			$value = get_noptin_subscriber_meta( $this->id, $key, $single );
		}

		return apply_filters( "get_noptin_subscriber_field_$key", $value, $this, $single );

	}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.2.7Introduced.

Top ↑

User Contributed Notes User Contributed Notes

30 day money back guarantee
Safe & Secure online payment
Custom CSS Slide Example
Custom Animation Example
Default Animation