first commit

This commit is contained in:
2023-09-12 21:41:04 +02:00
commit 3361a7f053
13284 changed files with 2116755 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?php
namespace WPML\LIB\WP;
use WPML\FP\Either;
use WPML\FP\Logic;
class WordPress {
/**
* Compare the WordPress version.
* @param string $operator
* @param string $version
*
* @return bool
*/
public static function versionCompare( $operator, $version ) {
global $wp_version;
return version_compare( $wp_version, $version, $operator );
}
/**
* @param mixed $var
*
* @return \WPML\FP\Either|callable
*/
public static function handleError( $var = null ) {
return call_user_func_array( Logic::ifElse( 'is_wp_error', Either::left(), Either::right() ), func_get_args() );
}
}