<?php

namespace Cart\notify;

defined( 'ABSPATH' ) || exit;

/**
 * common function handler
 * 
 */

if ( ! function_exists( 'notify_opts' ) ) {
	function notify_opts( $option = '', $default = null ) {
		$options = get_option( \Cart\notify\Settings\Repository::OPTION_KEY, array() );
		$options = is_array( $options ) ? $options : array();

		if ( '' === $option ) {
			return $options;
		}

		return isset( $options[ $option ] ) ? $options[ $option ] : $default;
	}
}
