\

Namespaces

MainWP

Constants

DAY_IN_SECONDS

DAY_IN_SECONDS = 24 * 60 * 60

Defines days in seconds.

DAY_IN_SECONDS

DAY_IN_SECONDS = 24 * 60 * 60

Defines days in seconds.

DIRECTORY_SEPARATOR

DIRECTORY_SEPARATOR = '/'

Defines reusable directory separator.

DOING_AJAX

DOING_AJAX = true

Checks whether ajax job is in progress.

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

DOING_CRON

DOING_CRON = true

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

DOING_CRON

DOING_CRON = true

Checks whether cron is in progress.

FS_METHOD

FS_METHOD = 'direct'

FS_METHOD

FS_METHOD = 'direct'

Define WordPress File system.

MAINWP_CHILD_DEBUG

MAINWP_CHILD_DEBUG = false

Define MainWP Child Plugin Debug Mode.

MAINWP_CHILD_FILE

MAINWP_CHILD_FILE = __FILE__

Define MainWP Child Plugin absolute full path and filename of this file.

MAINWP_CHILD_PLUGIN_DIR

MAINWP_CHILD_PLUGIN_DIR = plugin_dir_path(MAINWP_CHILD_FILE)

Define MainWP Child Plugin Directory.

MAINWP_CHILD_URL

MAINWP_CHILD_URL = plugin_dir_url(MAINWP_CHILD_FILE)

Define MainWP Child Plugin URL.

MAINWP_PLUGIN_DIR

MAINWP_PLUGIN_DIR = plugin_dir_path(MAINWP_PLUGIN_FILE)

Define MainWP Dashboard Plugin Directory.

MAINWP_PLUGIN_FILE

MAINWP_PLUGIN_FILE = __FILE__

Define MainWP Dashboard Plugin absolute full path and filename of this file.

MAINWP_PLUGIN_URL

MAINWP_PLUGIN_URL = plugin_dir_url(MAINWP_PLUGIN_FILE)

Define MainWP Child Dashboard URL.

MAINWP_REST_API

MAINWP_REST_API = true

MAINWP_SAVE_FS_METHOD

MAINWP_SAVE_FS_METHOD = get_filesystem_method()

Defines save file system method.

MAINWP_TWITTER_MAX_SECONDS

MAINWP_TWITTER_MAX_SECONDS = 60 * 5

Defines MainWP Twitter Max Seconds.

MAINWP_VERSION

MAINWP_VERSION = $this->current_version

Defines MainWP Version.

PCLZIP_TEMPORARY_DIR

PCLZIP_TEMPORARY_DIR = $backupdir

Defines PCLZIP temporary directory.

WP_DEBUG

WP_DEBUG = false

Defines if WP is debug mode.

WP_INSTALLING

WP_INSTALLING = true

Defines whether WP is being installed.

Functions

mainwp_autoload()

mainwp_autoload(string  $class_name) : \require_once

Autoloader for all classes, pages & widgets

Parameters

string $class_name

Folder name class|pages|widgets.

Returns

\require_once —

$autoload_path;

mainwp_child_autoload()

mainwp_child_autoload(string  $class_name) 

MainWP Child Plugin Autoloader to load all other class files.

Parameters

string $class_name

Name of the class to load.

mainwp_child_helper()

mainwp_child_helper() : mixed

Method mainwp_child_helper()

Get MainWP Child helper instance.

Returns

mixed —

MainWP\Child\MainWP_Helper

mainwp_current_user_can()

mainwp_current_user_can(string  $cap_type = '', string  $cap) : boolean

Check permission level.

To compatible with extensions.

Parameters

string $cap_type

Group or type of capabilities.

string $cap

Capabilities for current user.

Returns

boolean —

true|false

mainwp_do_not_have_permissions()

mainwp_do_not_have_permissions(string  $where = '', boolean  $echo = true) : string|boolean

Detect permission level & display message to end user.

Parameters

string $where

User's location.

boolean $echo

Defines weather or not to echo error message.

Returns

string|boolean —

$msg|false

mainwpdir()

mainwpdir() : string

Grab MainWP Directory

Returns

string

wp_verify_nonce()

wp_verify_nonce(string  $nonce, string|integer  $action = -1) : false|integer

Verify that correct nonce was used with time limit.

The user is given an amount of time to use the token, so therefore, since the UID and $action remain the same, the independent variable is the time.

Parameters

string $nonce

Nonce that was used in the form to verify.

string|integer $action

Should give context to what is taking place and be the same when nonce was created.

Returns

false|integer —

False if the nonce is invalid, 1 if the nonce is valid and generated between 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.