Gocodebox_Banner_Notifier::notification_test_pmpro_setting( bool $value, array $data )

PMPro setting test.


Parameters Parameters

$value

(bool) (Required) The current test value.

$data

(array) (Required) Array from the notification with [0] setting name to check [1] value to check for.


Top ↑

Source Source

File: libraries/banner-notifications/src/notifications.php

	function notification_test_pmpro_setting( $value, $data ) {
		if ( ! is_array( $data ) || ! isset( $data[0] ) || ! isset( $data[1] ) ) {
			return false;
		}

		// remove the pmpro_ prefix if given
		if ( strpos( $data[0], 'pmpro_' ) === 0 ) {
			$data[0] = substr( $data[0], 6, strlen( $data[0] ) - 6 );
		}

		$option_value = get_option( 'pmpro_' . $data[0] );
		if ( isset( $option_value ) && $option_value == $data[1] ) {
			return true;
		} else {
			return false;
		}
	}

Top ↑

User Contributed Notes User Contributed Notes

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