Properties

$name

$name : string

Connector slug

Type

string

$actions

$actions : array

Actions registered for this connector

Type

array

$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

registered_post_type()

registered_post_type(string  $post_type, array  $args) 

Catch registration of post_types after initial loading, to cache its labels

Parameters

string $post_type

Post type slug.

array $args

Arguments used to register the post type.

callback_mainwp_post_created()

callback_mainwp_post_created(mixed  $website, string  $post_action, array  $data) 

Log create post.

Parameters

mixed $website

website.

string $post_action

post action.

array $data

post data array.

callback_mainwp_post_action()

callback_mainwp_post_action(object  $website, string  $post_action, array  $data, integer|false  $post_id, string  $type = '') 

Log all post status changes ( creating / updating / trashing )

Parameters

object $website

website.

string $post_action

post action.

array $data

post data array.

integer|false $post_id

post id.

string $type

post|page.

sanitize_data()

sanitize_data(array  $data) : array

Handle sanitize POST data.

Parameters

array $data

input data.

Returns

array