HEX
Server: Apache/2.4.65 (Unix) OpenSSL/1.1.1k
System: Linux server-manager.elshandawiily.com 4.18.0-553.87.1.el8_10.x86_64 #1 SMP Mon Dec 1 05:11:16 EST 2025 x86_64
User: elshanda (1002)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/elshanda/public_html/wp-content/plugins/woocommerce-multilingual/inc/functions-pure.php
<?php
/**
 * This file is automatically loaded by composer,
 * and it should only contain pure functions.
 *
 * Impure functions should go to the main functions.php
 * manually included so we can mock it in our unit tests.
 */
namespace WCML\functions;

use WPML\FP\Obj;

use function WPML\FP\curryN;

if ( ! function_exists( 'WCML\functions\getId' ) ) {
	/**
	 * Returns the object id.
	 *
	 * @param \stdClass|\WP_Post|\WC_Order|\WC_Data|array|null $object The object to get id.
	 * @return int|callable|null
	 */
	function getId( $object = null ) {
		$getId = function ( $object ) {
			return is_object( $object ) && method_exists( $object, 'get_id' )
				? $object->get_id()
				: Obj::prop( 'ID', $object );
		};
		return call_user_func_array( curryN( 1, $getId ), func_get_args() );
	}
}