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
string
WordPress filter or action name
Returns
integer
Calculated highest priority of WordPress filter or action
Check current permissions
checkCurrentPermissions(array $permissions, integer $logicOperator = \KocujIL\V12a\Enums\LogicOperator::OPERATOR_OR
) : boolean
Parameters
$permissions
array
Permissions to check
$logicOperator
integer
Logic 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
boolean
Permissions are correct (true) or not (false)
Check if it is debug mode
checkDebug(integer $checkJavascript = \KocujIL\V12a\Enums\CheckJavascript::NO
) : boolean
Parameters
$checkJavascript
integer
Check 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
boolean
It is debug mode (true) or not (false)
Check if IP address is in local network
checkIPLocal(string $ip) : boolean
Parameters
Returns
boolean
IP is in local network (true) or not (false)
Check if server IP address is in local network
checkServerIPLocal() : boolean
Returns
boolean
Server IP is in local network (true) or not (false)
Check if user IP address is in local network
checkUserIPLocal() : boolean
Returns
boolean
User IP is in local network (true) or not (false)
Get better random value
getBetterRandom(integer $min, integer $max) : integer
Parameters
$min
integer
Minimal value
$max
integer
Maximum value
Returns
integer
Random value
Get current url
getCurrentUrl() : string
Returns
string
Current URL
Get singleton instance
getInstance() : object
Static
Returns
object
Singleton 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
string
Parsed URL
Get script URL
getScriptUrl() : string
Get protocol for current URL
getUrlProtocol() : string
Returns
string
Protocol 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