__construct()
__construct()
MainWP_Hooks constructor.
Initialize MainWP_Hooks actions/filters upon creation of the object.
Class MainWP_Hooks
mainwp_log_debug(string $text)
Method mainwp_log_debug()
MainWP debug log.
string | $text | Debug text. |
None found |
mainwp_log_info(string $text)
Method mainwp_log_info()
MainWP log info.
string | $text | Info Text. |
None found |
mainwp_log_warning(string $text)
Method mainwp_log_warning()
MainWP log warning.
string | $text | Warning text. |
None found |
enqueue_meta_boxes_scripts()
Method enqueue_meta_boxes_scripts()
Enqueue Scripts for all Meta boxes.
None found |
mainwp_add_site(array $params) : array
Method mainwp_add_site()
Hook to add Child Site.
array | $params | site data fields: url, name, wpadmin, unique_id, groupids, ssl_verify, ssl_version, http_user, http_pass, websiteid - if edit site. |
Exception message.
$ret data fields: response, siteid.
since | 3.2.2 |
---|
hook_delete_site(boolean $site_id = false) : boolean|array
Method hook_delete_site()
Hook to delete Child Site.
boolean | $site_id | Child site ID. |
Return false if empty and return array error - Site not found | result - SUCCESS.
None found |
filter_clone_site(mixed $pluginFile, mixed $key, mixed $websiteid, mixed $cloneid, mixed $clone_url, boolean $force_update = false) : array
Method filter_clone_site()
Hook to clone site.
mixed | $pluginFile | Plugin file. |
mixed | $key | Key. |
mixed | $websiteid | Child site ID. |
mixed | $cloneid | Clone site ID. |
mixed | $clone_url | Clone site URL. |
boolean | $force_update | Force the update, true|false, Default: false. |
Site array to clone.
since | 3.4.4 |
---|
filter_delete_clone_site(mixed $pluginFile, mixed $key, string $clone_url = '', boolean $clone_site_id = false) : array
Method filter_delete_clone_site()
Hook to delete cloaned Child Site.
mixed | $pluginFile | Plugin file. |
mixed | $key | Key. |
string | $clone_url | Clone site URL. |
boolean | $clone_site_id | Clone site ID. |
Site array to delete.
None found |
mainwp_edit_site(array $params) : array
Method mainwp_edit_site()
Hook to edit Child Site.
array | $params | site data fields: websiteid, name, wpadmin, unique_id. |
Exception message.
$ret Child site ID.
since | 3.2.2 |
---|
hook_add_sub_left_menu(string $title, string $slug, string $href, integer $level = 1, string $parent_key = 'mainwp_tab')
Method hook_add_sub_left_menu()
Hook to add MainWP Left Menu item.
string | $title | Menu title. |
string | $slug | Menu slug. |
string | $href | Menu link. |
integer | $level | Menu level. |
string | $parent_key | Parent menu. |
None found |
get_activate_extension_notice(mixed $pluginFile) : string
Method get_activate_extension_notice()
Check for inactive MainWP Extensions & return an activation warning message.
mixed | $pluginFile | MainWP Extension to check. |
Activation notice.
None found |
cache_getcontext(string $page) : array
Method cache_getcontext()
Get cached search context for given page.
string | $page | Current MainWP Page. |
Cached Search Array.
None found |
cache_echo_body(string $page)
Method cache_echo_body()
Echo Cached Search Body.
string | $page | Current MainWP Page. |
None found |
cache_init(string $page)
Method cache_init()
Initiate search session variables for the current page.
string | $page | Current MainWP Page. |
None found |
cache_add_context(string $page, mixed $context)
Method cache_add_context()
Hook to add time & Search Context session variable.
string | $page | Current MainWP Page. |
mixed | $context | Time of search. |
None found |
cache_add_body(string $page, mixed $body)
Method cache_add_body()
Hook to add Search Body Session variable.
string | $page | Current MainWP Page. |
mixed | $body | Search body. |
None found |
select_sites_box(string $title = '', string $type = 'checkbox', boolean $show_group = true, boolean $show_select_all = true, string $class = '', string $style = '', array $selected_websites = array(), array $selected_groups = array())
Method select_sites_box()
Hook to select sites box.
string | $title | Input title. |
string | $type | Input type, radio. |
boolean | $show_group | Whether or not to show group, Default: true. |
boolean | $show_select_all | Whether to show select all. |
string | $class | Default = ''. |
string | $style | Default = ''. |
array | $selected_websites | Selected Child Sites. |
array | $selected_groups | Selected Groups. |
None found |
hook_notify_user(integer $userId, string $subject, string $content)
Method hook_notify_user()
Hook to send user a notification.
integer | $userId | User ID. |
string | $subject | Email Subject. |
string | $content | Email Content. |
None found |
get_error_message(object $msg, object $extra) : string
Method get_error_message()
Hook to get error message.
object | $msg | Error message. |
object | $extra | HTTP error message. |
Error message.
None found |
get_user_extension() : object
Method get_user_extension()
Hook to get user extension.
$row User extension.
None found |
hook_get_site_options(mixed $boolean, object $website, string $name = '') : string|null
Method hook_get_site_options()
Hook to get Child site options.
mixed | $boolean | Boolean check. |
object | $website | Child site object. |
string | $name | Option table name. |
Database query result (as string), or null on failure
None found |
hook_update_site_options(mixed $boolean, object $website, string $option, string $value) : string|null
Method hook_update_site_options()
Hook to get Child site options.
mixed | $boolean | Boolean check. |
object | $website | Child site object. |
string | $option | Option name. |
string | $value | Option value. |
Database query result (as string), or null on failure
None found |
hook_get_websites_by_user_id(mixed $boolean, integer $userid, boolean $selectgroups = false, null $search_site = null, string $orderBy = 'wp.url') : object|null
Get sites by user ID.
mixed | $boolean | Boolean check. |
integer | $userid | User ID. |
boolean | $selectgroups | Selected groups. |
null | $search_site | Site search field value. |
string | $orderBy | Order list by. Default: URL. |
Database query results or null on failure.
None found |
get_websites_by_url(string $url) : array|object|null
Method get_websites_by_url()
Hook to get Child Site by URL.
string | $url | Child Site URL. |
Database query results.
None found |
hook_get_all_posts(object $sites, array $post_data = array()) : \stdClass
Method hook_get_all_posts() Hook to get posts from sites.
object | $sites | Child Sites object. |
array | $post_data | with values: keyword, dtsstart, dtsstop, status, maxRecords, post_type. |
$output All posts data array.
since | 3.4.4 |
---|
hook_current_user_can(mixed $input, string $can_type, string $which) : boolean
Method mainwp_current_user_have_right()
Check permission level by hook mainwp_currentusercan of Team Control extension
mixed | $input | Return value holder. |
string | $can_type | group or type of capabilities. |
string | $which | Which function to perform. |
$input Return true if the user can and false if they can not.
None found |
hook_escape_response(mixed $response, boolean $fields = false, array $more_allowed = array()) : mixed
Method hook_escape_response()
To escape response data.
mixed | $response | response data. |
boolean | $fields | fields of response data - option. |
array | $more_allowed | input allowed tags - option. |
Exception message.
$response valid response data.
None found |
hook_secure_request(string $action = '', string $query_arg = 'security')
Method hook_secure_request()
Security check to request parameter
string | $action | Action to perform. |
string | $query_arg | Query argument. |
None found |
hook_get_mainwp_dir(boolean $false = false, null $dir = null, boolean $direct_access = false) : array
Method hook_get_mainwp_dir()
Hook to get MainWP Directory.
boolean | $false | False. |
null | $dir | WP files system diectories. |
boolean | $direct_access | Return true if Direct access file system. Default: false. |
$newdir, $url.
None found |
is_multi_user() : boolean
Method is_multi_user()
Hook to check if multi user.
true|false.
None found |
filter_qq2_file_uploader(mixed $allowedExtensions, mixed $sizeLimit) : \MainWP\Dashboard\MainWP_QQ2_File_Uploader
Method filter_qq2_file_uploader()
Hook to create new MainWP_QQ2_File_Uploader() class.
mixed | $allowedExtensions | Allowed files extentions. |
mixed | $sizeLimit | Maximum file size allowed to be uploaded. |
Return instance of MainWP_QQ2_File_Uploader
None found |
get_metaboxes_post() : string|boolean
Method get_metaboxes_post()
Hook to get meta boxes.
Return error or true.
None found |
get_formated_email(mixed $body, mixed $email, string $title = '') : string|boolean
Method get_formated_email()
Hook to format email.
mixed | $body | Email body. |
mixed | Email address. |
|
string | $title | Email title. |
Return error or true.
None found |
None found |
None found |
None found |
None found |
None found |
hook_get_websites_by_group_ids(mixed $ids, null $userId = null) : \MainWP\Dashboard\(object|\MainWP\Dashboard\null)
Method hook_get_websites_by_group_ids()
Hook to get Child Sites by group ID.
mixed | $ids | Group IDs. |
null | $userId | Current user ID. |
Database query result for get Child Sites by group ID or null on failure.
None found |