first commit
This commit is contained in:
31
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/WP.php
vendored
Normal file
31
wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/wp/classes/WP.php
vendored
Normal 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() );
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user