Methods
Calculate the highest priority of WordPress filter or action
calculateMaxPriority(string $name) : integer
| todo |
remove checking if $wp_filter is an array, when this library will have 4.7 as the minimal supported WordPress version |
| access |
public |
Parameters
$name
stringWordPress filter or action name
Returns
integerCalculated highest priority of WordPress filter or action
Check current permissions
checkCurrentPermissions(array $permissions, integer $logicOperator = \KocujIL\V12a\Enums\LogicOperator::OPERATOR_OR) : boolean
Parameters
$permissions
arrayPermissions to check
$logicOperator
integerLogic operator; must be one of the following constants from \KocujIL\V12a\Enums\LogicOperator: OPERATOR_OR ("OR" operator) or OPERATOR_AND ("AND" operator) - default: \KocujIL\V12a\Enums\LogicOperator::OPERATOR_OR
Returns
booleanPermissions are correct (true) or not (false)
Check if it is debug mode
checkDebug(integer $checkJavascript = \KocujIL\V12a\Enums\CheckJavascript::NO) : boolean
Parameters
$checkJavascript
integerCheck JavaScript; must be one of the following constants from \KocujIL\V12a\Enums\CheckJavascript: NO (when JavaScript should not be checked) or YES (when JavaScript should be checked) - default: \KocujIL\V12a\Enums\CheckJavascript::NO
Returns
booleanIt is debug mode (true) or not (false)
Check if IP address is in local network
checkIPLocal(string $ip) : boolean
Parameters
Returns
booleanIP is in local network (true) or not (false)
Check if server IP address is in local network
checkServerIPLocal() : boolean
Returns
booleanServer IP is in local network (true) or not (false)
Check if user IP address is in local network
checkUserIPLocal() : boolean
Returns
booleanUser IP is in local network (true) or not (false)
Get better random value
getBetterRandom(integer $min, integer $max) : integer
Parameters
$min
integerMinimal value
$max
integerMaximum value
Returns
integerRandom value
Get current url
getCurrentUrl() : string
Returns
stringCurrent URL
Get singleton instance
getInstance() : object
Static
Returns
objectSingleton instance
Get prefix for some names in library
getPrefix() : string
Get real URL; it is similar to "realpath()" but it parse URL-s
getRealUrl(string $url) : string
Parameters
Returns
stringParsed URL
Get script URL
getScriptUrl() : string
Get protocol for current URL
getUrlProtocol() : string
Returns
stringProtocol for current URL
Disable cloning of object
__clone() : void
Constructor
__construct() : void
Properties
Singleton instance
$instance : object
Static
Remembered script URL
$scriptUrl : string
Script URL is remembered in $this->scriptUrl property (true) or not and should be updated (false)
$scriptUrlRemember : boolean