# filter-everything/trunk/src/wpc-compat.php

Filter Everything — WordPress &amp; WooCommerce Filters, version trunk. 75 lines.

- Page: https://pluginprobe.com/plugins/filter-everything/trunk/code/src/wpc-compat.php
- Raw: https://pluginprobe.com/plugins/filter-everything/trunk/raw/src/wpc-compat.php
- Modified: 2024-04-08T22:05:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/filter-everything/trunk/code/src/wpc-compat.php#L10-L20`.

```php
<?php

if ( ! defined('ABSPATH') ) {
    exit;
}

if( ! function_exists('mb_strpos') ){
    function mb_strpos( $haystack, $needle, $offset = 0, $encoding = null )
    {
        return strpos( $haystack, $needle, $offset = 0 );
    }
}

if( ! function_exists('mb_strcut') ){
    function mb_strcut( $string, $start, $length = null, $encoding = null )
    {
        return substr( $string, $start, $length = null  );
    }
}

if( ! function_exists('mb_strlen') ){
    function mb_strlen( $string, $encoding = null )
    {
        return strlen( $string );
    }
}

if( ! function_exists('mb_strtolower') ){
    function mb_strtolower( $string, $encoding = null  )
    {
        return strtolower( $string );
    }
}

if( ! function_exists('mb_strtoupper') ){
    function mb_strtoupper( $string )
    {
        return strtoupper( $string );
    }
}

if( ! function_exists('mb_substr') ){
    function mb_substr( $string , $start, $length = null, $encoding = null )
    {
        return substr( $string, $start, $length = null );
    }
}

if (!function_exists('array_key_first')) {
    function array_key_first(array $arr) {
        foreach($arr as $key => $unused) {
            return $key;
        }
        return NULL;
    }
}

if( ! function_exists( 'intdiv' ) ){
    function intdiv( $a, $b ){
        return ($a - $a % $b) / $b;
    }
}

if( !function_exists('array_key_last') ) {
    function array_key_last(array $array) {
        if( !empty($array) ) return key(array_slice($array, -1, 1, true));
    }
}

if( ! function_exists('is_login') ) {
    function is_login()
    {
        return false !== stripos( wp_login_url(), $_SERVER['SCRIPT_NAME'] );
    }
}
```
