log_noptin_message( mixed $message, string $code = 'error' )

Logs a message.


Description Description

See also See also


Top ↑

Parameters Parameters

$message

(mixed) (Required) The message to log.

$code

(string) (Optional) The error code.

Default value: 'error'


Top ↑

Return Return

(bool.)


Top ↑

Source Source

File: includes/functions.php

function log_noptin_message( $message, $code = 'error' ) {

	if ( is_wp_error( $message ) ) {
		$message = $message->get_error_message();
	}

	$message = noptin_clean( $message );

	// Next, retrieve the array of existing logged messages.
	$messages   = get_logged_noptin_messages();

	// Add our message.
	$messages[] = array(
		'level'	=> $code,
		'msg'	=> $message,
		'time'	=> current_time( 'mysql' ),
	);

	// Then save to the database.
	return update_option( 'noptin_logged_messages', $messages );

}


Top ↑

Changelog Changelog

Changelog
VersionDescription
1.2.3Introduced.

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