woocommerce-multilingual
/
addons
/
wpml-dependencies
/
lib
/
classes
/
wpml-wp
/
wpml-php-functions.php
class-wpml-wp-api.php
4 weeks ago
class-wpml-wp-roles.php
4 weeks ago
class-wpml-wp-taxonomy.php
4 weeks ago
iwpml-wp-element-type.php
4 weeks ago
wpml-php-functions.php
4 weeks ago
wpml-wp-post-type.php
4 weeks ago
wpml-php-functions.php
57 lines
| 1 | <?php |
| 2 | |
| 3 | class WPML_PHP_Functions { |
| 4 | |
| 5 | public function defined( $constant_name ) { |
| 6 | return defined( $constant_name ); |
| 7 | } |
| 8 | |
| 9 | public function constant( $constant_name ) { |
| 10 | return $this->defined( $constant_name ) ? constant( $constant_name ) : null; |
| 11 | } |
| 12 | |
| 13 | public function function_exists( $function_name ) { |
| 14 | return function_exists( $function_name ); |
| 15 | } |
| 16 | |
| 17 | public function class_exists( $class_name, $autoload = true ) { |
| 18 | return class_exists( $class_name, $autoload ); |
| 19 | } |
| 20 | |
| 21 | public function extension_loaded( $name ) { |
| 22 | return extension_loaded( $name ); |
| 23 | } |
| 24 | |
| 25 | public function mb_strtolower( $string ) { |
| 26 | if ( function_exists( 'mb_strtolower' ) ) { |
| 27 | return mb_strtolower( $string ); |
| 28 | } |
| 29 | |
| 30 | return strtolower( $string ); |
| 31 | } |
| 32 | |
| 33 | public function phpversion( $extension = null ) { |
| 34 | if ( defined( 'PHP_VERSION' ) ) { |
| 35 | return PHP_VERSION; |
| 36 | } else { |
| 37 | return phpversion( $extension ); |
| 38 | } |
| 39 | } |
| 40 | |
| 41 | public function version_compare( $version1, $version2, $operator = null ) { |
| 42 | return version_compare( $version1, $version2, $operator ); |
| 43 | } |
| 44 | |
| 45 | public function array_unique( $array, $sort_flags = SORT_REGULAR ) { |
| 46 | return wpml_array_unique( $array, $sort_flags ); |
| 47 | } |
| 48 | |
| 49 | public function error_log( $message, $message_type = null, $destination = null, $extra_headers = null ) { |
| 50 | return error_log( $message, $message_type, $destination, $extra_headers ); |
| 51 | } |
| 52 | |
| 53 | public function exit_php() { |
| 54 | exit(); |
| 55 | } |
| 56 | } |
| 57 |