$instance
$instance : mixed
Private static variable to hold the single instance of the class.
Class MainWP_System_Utility
instance() : \MainWP\Dashboard\MainWP_Post_Handler
Method instance()
Create a public static instance.
current_user_has_role(array|string $roles, object|null $user = null) : boolean
Method current_user_has_role()
Check if the user has role.
array|string | $roles | role or array of roles to check. |
object|null | $user | user check. |
true|false If the user is administrator (Level 10), return true, if not, return false.
get_mainwp_dir(string|null $subdir = null, boolean $direct_access = false) : array
Method get_mainwp_dir()
Get the MainWP directory, if it doesn't exist create it.
string|null | $subdir | mainwp sub diectories. |
boolean | $direct_access | Return true if Direct access file system. Default: false. |
$dir, $url
get_mainwp_sub_dir(string|null $subdir = null, boolean $direct_access = false) : string
Method get_mainwp_sub_dir()
Get the MainWP directory, if it doesn't exist create it.
string|null | $subdir | mainwp sub diectories. |
boolean | $direct_access | Return true if Direct access file system. Default: false. |
$dir mainwp sub-directory.
update_cached_icons(string $icon, string $slug, string $type, boolean $custom_icon = false)
Method update_cached_icons().
Update cached icons
string | $icon | The icon. |
string | $slug | slug. |
string | $type | Type: plugin|theme. |
boolean | $custom_icon | Custom icon or not. Default: false. |
handle_upload_image(string $sub_folder, mixed $file_uploader, mixed $file_index, boolean $file_subindex = false, integer $max_width = 300, integer $max_height = 300)
Method handle_upload_image().
Handle upload icons.
string | $sub_folder | The sub folder. |
mixed | $file_uploader | The file uploader. |
mixed | $file_index | The index of file uploader. |
boolean | $file_subindex | Is file with sub index. |
integer | $max_width | max image width. |
integer | $max_height | max image height. |