Methods

get_class_name()

get_class_name() : object

Method get_class_name()

Get Class Name.

Returns

object

is_admin()

is_admin() : boolean

Method is_admin()

Check if current user is an administrator.

Returns

boolean —

True|False.

get_primary_backup()

get_primary_backup() : mixed

Method get_primary_backup()

Check if using Legacy Backup Solution.

Returns

mixed —

False|$enable_legacy_backup.

get_notification_email()

get_notification_email(null  $user = null) : mixed

Method get_notification_email()

Check if user wants to recieve MainWP Notification Emails.

Parameters

null $user

User Email Address.

Returns

mixed —

null|User Email Address.

get_base_dir()

get_base_dir() : string

Method get_base_dir()

Get the base upload directory.

Returns

string —

basedir/

get_icons_dir()

get_icons_dir() : array

Method get_icons_dir()

Get MainWP icons directory, if it doesn't exist create it.

Returns

array —

$dir, $url

get_mainwp_dir()

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.

Parameters

string|null $subdir

mainwp sub diectories.

boolean $direct_access

Return true if Direct access file system. Default: false.

Returns

array —

$dir, $url

get_mainwp_sub_dir()

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.

Parameters

string|null $subdir

mainwp sub diectories.

boolean $direct_access

Return true if Direct access file system. Default: false.

Returns

string —

$dir mainwp sub-directory.

get_download_url()

get_download_url(mixed  $what, mixed  $filename) : string

Method get_download_dir()

Parameters

mixed $what

What url.

mixed $filename

File Name.

Returns

string —

Download URL.

get_mainwp_specific_dir()

get_mainwp_specific_dir(null  $dir = null) : string

Method get_mainwp_specific_dir()

Get MainWP Specific directory, if it doesn't exist create it.

Update .htaccess.

Parameters

null $dir

Current MainWP directory.

Returns

string —

$newdir

get_mainwp_specific_url()

get_mainwp_specific_url(mixed  $dir) : string

Method get_mainwp_specific_url()

Get MainWP specific URL.

Parameters

mixed $dir

MainWP Directory.

Returns

string —

MainWP URL.

get_wp_file_system()

get_wp_file_system() : boolean

Method get_wp_file_system()

Get WP file system & define Global Variable FS_METHOD.

Returns

boolean —

$init True.

can_edit_website()

can_edit_website(mixed  $website) : mixed

Method can_edit_website()

Check if current user can edit Child Site.

Parameters

mixed $website

Child Site.

Returns

mixed —

true|false|userid

get_current_wpid()

get_current_wpid() : string

Method get_current_wpid()

Get current Child Site ID.

Returns

string —

$current_user->current_site_id Current Child Site ID.

set_current_wpid()

set_current_wpid(mixed  $wpid) 

Method set_current_wpid()

Set the current Child Site ID.

Parameters

mixed $wpid

Child Site ID.

get_page_id()

get_page_id(null  $screen = null) : string

Method get_page_id()

Get current Page ID.

Parameters

null $screen

Current Screen ID.

Returns

string —

$page Current page ID.

get_child_response()

get_child_response(mixed  $data) : \MainWP\Dashboard\json

Method get_child_response()

Get response from Child Site.

Parameters

mixed $data

Data to process.

Returns

\MainWP\Dashboard\json —

$data|true.

maybe_unserialyze()

maybe_unserialyze(mixed  $data) : mixed

Method maybe_unserialyze()

Check if $data is serialized, if it isn't then base64_decode it.

Parameters

mixed $data

Data to check.

Returns

mixed —

$data.

get_openssl_conf()

get_openssl_conf() 

Method get_openssl_conf()

Get dashboard openssl configuration.

get_tokens_site_values()

get_tokens_site_values(object  $site) : array

Get tokens of site.

Parameters

object $site

The website.

Returns

array —

Array of tokens.

replace_tokens_values()

replace_tokens_values(string  $string, array  $replace_tokens) : string

Replace site tokens.

Parameters

string $string

String data.

array $replace_tokens

array of tokens.

Returns

string —

content with replaced tokens.

set_time_limit()

set_time_limit(integer  $timeout) 

Set timeout limit.

Parameters

integer $timeout

timeout value.