| 1 |
<?php |
| 2 |
|
| 3 |
if ( ! defined('ABSPATH') ) { |
| 4 |
exit; |
| 5 |
} |
| 6 |
|
| 7 |
if( ! function_exists('mb_strpos') ){ |
| 8 |
function mb_strpos( $haystack, $needle, $offset = 0, $encoding = null ) |
| 9 |
{ |
| 10 |
return strpos( $haystack, $needle, $offset = 0 ); |
| 11 |
} |
| 12 |
} |
| 13 |
|
| 14 |
if( ! function_exists('mb_strcut') ){ |
| 15 |
function mb_strcut( $string, $start, $length = null, $encoding = null ) |
| 16 |
{ |
| 17 |
return substr( $string, $start, $length = null ); |
| 18 |
} |
| 19 |
} |
| 20 |
|
| 21 |
if( ! function_exists('mb_strlen') ){ |
| 22 |
function mb_strlen( $string, $encoding = null ) |
| 23 |
{ |
| 24 |
return strlen( $string ); |
| 25 |
} |
| 26 |
} |
| 27 |
|
| 28 |
if( ! function_exists('mb_strtolower') ){ |
| 29 |
function mb_strtolower( $string, $encoding = null ) |
| 30 |
{ |
| 31 |
return strtolower( $string ); |
| 32 |
} |
| 33 |
} |
| 34 |
|
| 35 |
if( ! function_exists('mb_strtoupper') ){ |
| 36 |
function mb_strtoupper( $string ) |
| 37 |
{ |
| 38 |
return strtoupper( $string ); |
| 39 |
} |
| 40 |
} |
| 41 |
|
| 42 |
if( ! function_exists('mb_substr') ){ |
| 43 |
function mb_substr( $string , $start, $length = null, $encoding = null ) |
| 44 |
{ |
| 45 |
return substr( $string, $start, $length = null ); |
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
if (!function_exists('array_key_first')) { |
| 50 |
function array_key_first(array $arr) { |
| 51 |
foreach($arr as $key => $unused) { |
| 52 |
return $key; |
| 53 |
} |
| 54 |
return NULL; |
| 55 |
} |
| 56 |
} |
| 57 |
|
| 58 |
if( ! function_exists( 'intdiv' ) ){ |
| 59 |
function intdiv( $a, $b ){ |
| 60 |
return ($a - $a % $b) / $b; |
| 61 |
} |
| 62 |
} |
| 63 |
|
| 64 |
if( !function_exists('array_key_last') ) { |
| 65 |
function array_key_last(array $array) { |
| 66 |
if( !empty($array) ) return key(array_slice($array, -1, 1, true)); |
| 67 |
} |
| 68 |
} |
| 69 |
|
| 70 |
if( ! function_exists('is_login') ) { |
| 71 |
function is_login() |
| 72 |
{ |
| 73 |
return false !== stripos( wp_login_url(), $_SERVER['SCRIPT_NAME'] ); |
| 74 |
} |
| 75 |
} |