Properties

$name

$name : string

Connector name.

Type

string — Connector slug.

$actions

$actions : array

Connector name.

Type

array — Actions registered for this connector.

$is_registered

$is_registered : boolean

Holds connector registration status flag.

Type

boolean

Methods

is_registered()

is_registered() : boolean

Is the connector currently registered?

Returns

boolean

register()

register() 

Register log data.

callback()

callback() 

Callback for all registered hooks throughout Log Looks for a class method with the convention: "callback_{action name}"

log()

log(string  $message, array  $args, integer  $site_id, string  $context, string  $action, integer|null  $state = null, integer  $user_id = null) : boolean

Log handler

Parameters

string $message

sprintf-ready error message string.

array $args

sprintf (and extra) arguments to use.

integer $site_id

Target site id.

string $context

Context of the event.

string $action

Action of the event.

integer|null $state

action status: null - N/A, 0 - failed, 1 - success.

integer $user_id

User responsible for the event.

Returns

boolean

get_changed_keys()

get_changed_keys(mixed  $old_value, mixed  $new_value, boolean|integer  $deep = false) : array

Compare two values and return changed keys if they are arrays

Parameters

mixed $old_value

Value before change.

mixed $new_value

Value after change.

boolean|integer $deep

Get array children changes keys as well, not just parents.

Returns

array

get_label()

get_label() : string

Return translated connector label.

Returns

string —

Translated connector label.

get_action_labels()

get_action_labels() : array

Return translated action labels.

Returns

array —

Action label translations.

get_context_labels()

get_context_labels() : array

Return translated context labels.

Returns

array —

Context label translations.

callback_mainwp_site_added()

callback_mainwp_site_added(object  $website, array  $information = array()) : boolean

Log site added process.

Parameters

object $website

Website object data.

array $information

Sync array data.

Returns

boolean —

Return TRUE.

callback_mainwp_site_sync()

callback_mainwp_site_sync(object  $website, array  $information, boolean  $success, string  $sync_error = '', array  $post_data = array()) : boolean

Log site sync process.

Parameters

object $website

Website object data.

array $information

Sync array data.

boolean $success

Sync success or failed.

string $sync_error

Sync error data (options).

array $post_data

addition post data (options).

Returns

boolean —

Return TRUE.

callback_mainwp_site_deleted()

callback_mainwp_site_deleted(object  $website) : boolean

Log site sync process.

Parameters

object $website

Website object data.

Returns

boolean —

Return TRUE.

callback_mainwp_site_reconnected()

callback_mainwp_site_reconnected(object  $website, boolean  $success = true, string  $error = '') : boolean

Log site sync process.

Parameters

object $website

Website object data.

boolean $success

success or not.

string $error

reconnect error.

Returns

boolean —

Return TRUE.

callback_mainwp_site_updated()

callback_mainwp_site_updated(object  $website, array  $post_values) : boolean

Log site updated process.

Parameters

object $website

Website object data.

array $post_values

POST values.

Returns

boolean —

Return TRUE.

callback_mainwp_site_suspended()

callback_mainwp_site_suspended(object  $website, integer  $suspended) : boolean

Log site updated suspended process.

Parameters

object $website

Website object data.

integer $suspended

suspended value.

Returns

boolean —

Return TRUE.

callback_mainwp_site_tag_action()

callback_mainwp_site_tag_action(object  $tag, string  $action, array  $data = array()) : boolean

Log Tag actions.

Parameters

object $tag

tag object data.

string $action

tag action.

array $data

other data array (option).

Returns

boolean —

Return TRUE.

sanitize_data()

sanitize_data(array  $data) : array

Handle sanitize POST data.

Parameters

array $data

input data.

Returns

array