<?php
/**
 * Overridable pluggable functions for Tripzzy.
 *
 * @package tripzzy
 */

// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
if ( ! function_exists( 'tripzzy_version' ) ) {
	/**
	 * Return the current version of tripzzy.
	 *
	 * @return string
	 */
	function tripzzy_version() {
		return TRIPZZY_VERSION;
	}
}

if ( ! function_exists( 'tripzzy_domain_name' ) ) {
	/**
	 * Return the domain name.
	 *
	 * @return string
	 */
	function tripzzy_domain_name() {
		$site_url    = get_site_url();
		$domain_name = wp_parse_url( $site_url, PHP_URL_HOST );
		return $domain_name;
	}
}

if ( ! function_exists( 'tripzzy_maybe_define_constant' ) ) {
	/**
	 * Define a constant if it is not already defined.
	 *
	 * @since 1.3.4
	 * @param string $name  Constant name.
	 * @param mixed  $value Value.
	 */
	function tripzzy_maybe_define_constant( $name, $value ) {
		if ( ! defined( $name ) ) {
			define( $name, $value ); // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.VariableConstantNameFound
		}
	}
}
