woocommerce-multilingual
/
addons
/
wpml-dependencies
/
vendor
/
wpml
/
wp
/
classes
Last commit date
Attachment.php
1 month ago
Cache.php
1 month ago
Gutenberg.php
1 month ago
Hooks.php
1 month ago
Http.php
1 month ago
Nonce.php
1 month ago
Option.php
1 month ago
Post.php
1 month ago
PostType.php
1 month ago
Resources.php
1 month ago
Roles.php
4 years ago
Transient.php
1 month ago
Url.php
1 month ago
User.php
1 month ago
WP.php
1 month ago
WPDB.php
1 month ago
WP.php
20 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPML\LIB\WP; |
| 4 | |
| 5 | use WPML\FP\Either; |
| 6 | use WPML\FP\Logic; |
| 7 | |
| 8 | class WordPress { |
| 9 | |
| 10 | public static function versionCompare( $operator, $version ) { |
| 11 | global $wp_version; |
| 12 | return version_compare( $wp_version, $version, $operator ); |
| 13 | } |
| 14 | |
| 15 | public static function handleError( $var = null ) { |
| 16 | return call_user_func_array( Logic::ifElse( 'is_wp_error', Either::left(), Either::right() ), func_get_args() ); |
| 17 | } |
| 18 | |
| 19 | } |
| 20 |