__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 |
mainwp_log_action(string $text, integer $priority, integer $log_color, boolean $forced = false)
Method mainwp_log_action()
MainWP log action.
string | $text | Debug text. |
integer | $priority | priority: -1 disabled, 0 - log, 1 - warning, 2 - info, 3 - debug. |
integer | $log_color | Set color: 0 - LOG, 1 - WARNING, 2 - INFO, 3- DEBUG. |
boolean | $forced | forced logging. |
None found |
mainwp_log_execution_time(string $text = '')
Method mainwp_log_execution_time()
MainWP log execution time.
string | $text | Debug 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 |
---|
is_pro_member(mixed $input = false) : boolean
Method is_pro_member()
Check for inactive MainWP Extensions.
mixed | $input | Input value. |
Activation notice.
None found |
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 |
is_extension_activated(mixed $input, mixed $slug) : boolean
Method is_extension_activated()
Check for inactive MainWP Extensions.
mixed | $input | Input value. |
mixed | $slug | MainWP Extension to check. |
Activation notice.
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 |
hook_select_sites_box(string $title = '', string $type = 'checkbox', boolean $show_group = true, boolean $show_select_all = true, string $class_style = '', string $style = '', array $selected_websites = array(), array $selected_groups = array(), boolean $show_client = false, array $selected_clients = array(), mixed $post_id = false, boolean $show_create_tag = true)
Method hook_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_style | Default = ''. |
string | $style | Default = ''. |
array | $selected_websites | Selected Child Sites. |
array | $selected_groups | Selected Groups. |
boolean | $show_client | Show Clients. |
array | $selected_clients | Selected Clients. |
mixed | $post_id | post ID. |
boolean | $show_create_tag | Show create tag button. |
None found |
hook_add_categories_box(integer $post_id = false)
Method hook_add_categories_box()
General categories box.
integer | $post_id | Post ID. |
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 |
hook_get_user_extension() : object
Method hook_get_user_extension()
Hook to get user extension.
$row User extension.
None found |
update_user_extension(boolean $input_value, string $option_name, mixed $option_value) : boolean
Method update_user_extension()
Hook to update user extension.
boolean | $input_value | input filter value. |
string | $option_name | option name. |
mixed | $option_value | option value. |
true.
None found |
hook_get_site_options(mixed $boolean, object $website, string|array $options = '') : string|null
Method hook_get_site_options()
Hook to get Child site options.
mixed | $boolean | Boolean check. |
object | $website | Child site object. |
string|array | $options | 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 |
hook_get_website_by_id(mixed $boolean, integer $website_id, boolean $selectGroups = false, array $extra_view = array()) : object|null
Get sites by website ID.
mixed | $boolean | Boolean check. |
integer | $website_id | User ID. |
boolean | $selectGroups | Select groups. |
array | $extra_view | get extra option fields. |
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_escape_content(mixed $content, string $type = 'note', array $more_allowed = array()) : mixed
Method hook_escape_content()
To escape content.
mixed | $content | response data. |
string | $type | content type for escape. |
array | $more_allowed | input allowed tags - option. |
Exception message.
$response valid response data.
None found |
db_free_result(mixed $input_value, mixed $result) : boolean
Method db_free_result()
To escape response data.
mixed | $input_value | input value. |
mixed | $result | result data. |
true.
None found |
db_num_rows(mixed $input_value, mixed $result) : boolean
Method db_num_rows()
To escape response data.
mixed | $input_value | input value. |
mixed | $result | result data. |
true.
None found |
db_get_websites_for_current_user(mixed $input_value = false, array $params = array()) : mixed
Method db_get_websites_for_current_user()
To escape response data.
mixed | $input_value | input value. |
array | $params | params data. |
websites.
None found |
hook_sync_website(mixed $input_value, integer $website_id, boolean $fire_end_session = true) : mixed
Method hook_sync_website()
To escape response data.
mixed | $input_value | input value. |
integer | $website_id | Website ID. |
boolean | $fire_end_session | to run the ending session or not. |
websites.
None found |
hook_db_data_seek(mixed $result, integer $offset)
Method hook_db_data_seek()
To escape response data.
mixed | $result | result data. |
integer | $offset | offset of data. |
None found |
hook_db_query(mixed $input_value, string $sql) : boolean
Method hook_db_query()
To query db.
mixed | $input_value | filter input value. |
string | $sql | result data. |
true.
None found |
db_fetch_object(mixed $input_value, mixed $result) : boolean
Method db_fetch_object()
To escape response data.
mixed | $input_value | input value. |
mixed | $result | result data. |
true.
None found |
db_fetch_array(mixed $input_value, mixed $result) : boolean
Method db_fetch_array()
To escape response data.
mixed | $input_value | input value. |
mixed | $result | result data. |
true.
None found |
get_notification_settings(string $settings, string $type) : array
Get notification email settings.
string | $settings | hook settings input value. |
string | $type | Notification type. |
$gen_email_settings email settings.
None found |
hook_send_wp_mail(string $input, string $email, string $subject, boolean $formated_content, string $content_type = '')
Hook send_wp_mail().
Send email via wp_mail().
string | $input | hook input value. |
string | send to email. |
|
string | $subject | email content. |
boolean | $formated_content | email content. |
string | $content_type | Text format. |
None found |
hook_get_template_html(string $input, string $template_name, array $args = array()) : string
Hook get template HTML content.
string | $input | hooks input value. |
string | $template_name | Template name. |
array | $args | Arguments. (default: array). |
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_check_security_request(boolean $input_value, string $action = '', string $query_arg = '')
Method hook_check_security_request()
Security check to request parameter
boolean | $input_value | Input value. |
string | $action | Action to perform. |
string | $query_arg | Query argument. |
None found |
hook_get_mainwp_dir(boolean $input_value = false, null $dir = null, boolean $direct_access = false) : array
Method hook_get_mainwp_dir()
Hook to get MainWP Directory.
boolean | $input_value | 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 |
hook_notification_email() : string
Method hook_notification_email()
Hook to get notification email.
Return email.
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 |
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 |
hook_posts_get_edit()
Method hook_posts_get_edit()
Get and create post to edit.
None found |
hook_posts_bulk_posting()
Method hook_posts_bulk_posting()
Post Bulk posting.
None found |
hook_atarim_default_sitestable_column(mixed $columns)
Method hook_atarim_default_sitestable_column()
mixed | $columns | columns data. Hook Atarim default column. |
None found |
hook_atarim_manage_sites_default_item(mixed $item)
Method hook_atarim_manage_sites_default_item()
mixed | $item | item row data. Hook Atarim manage sites default item. |
None found |
hook_get_website_client_tokens(mixed $input_value, integer $websiteid = false) : mixed
Method hook_get_website_client_tokens()
Hook get client tokens.
mixed | $input_value | input filter value. |
integer | $websiteid | Website ID. |
$result Result of tokens.
None found |
hook_get_download_sig(string $input_value, string $fullfile) : string
Method hook_get_download_sig()
Hook get download sig.
string | $input_value | Input value. |
string | $fullfile | Full file path. |
None found |
hook_secure_download(string $false_value, string $fullfile, string $sig)
Method hook_download_valid_sig().
Hook get download sig.
string | $false_value | false value. |
string | $fullfile | Full file path. |
string | $sig | sig value. |
None found |
hook_ajax_add_action(string $action, string $callback, integer $priority = 10, integer $accepted = 2)
Method hook_ajax_add_action().
Hook add ajax action.
string | $action | action name. |
string | $callback | callback function. |
integer | $priority | priority action. |
integer | $accepted | number args. |
None found |
hook_get_plugin_icon(mixed $icon, string $slug)
Method hook_get_plugin_icon().
Hook get plugin icon.
mixed | $icon | input icon. |
string | $slug | Plugin slug. |
None found |
hook_get_theme_icon(mixed $icon, string $slug)
Method hook_get_theme_icon().
Hook get theme icon.
mixed | $icon | input icon. |
string | $slug | Theme slug. |
None found |
hook_get_dir_slug(mixed $input, string $slug)
Method hook_get_dir_slug().
Hook get dir slug of plugin/theme.
mixed | $input | input value. |
string | $slug | Plugin/Theme slug. |
None found |
hook_do_widget_boxes(mixed $screen_id, string|null $context = null, string $input_obj = '') : void
Method hook_do_widget_boxes()
Customize WordPress do_meta_boxes() function.
mixed | $screen_id | Current page ID. |
string|null | $context | right|null. If 3 columns then = 'middle'. |
string | $input_obj | Empty string. |
None found |
hook_add_widget_box(mixed $id, mixed $callback, null $screen = null, string|null $layout = null) : void
Method hook_add_widget_box()
Hook add MainWP meta box.
mixed | $id | Widget ID parameter. |
mixed | $callback | Callback function. |
null | $screen | Current page. |
string|null | $layout | widget's layout . |
None found |
hook_render_modal_upload_icon()
Method hook_render_modal_upload_icon()
Render modal window for upload plugins & themes icon.
None found |
hook_render_plugin_details_modal()
Method hook_render_plugin_details_modal()
Render modal window plugin details.
None found |
hook_render_updates()
Method hook_render_updates()
Render modal window updates details.
None found |
hook_get_wp_client_by(string $by = 'client_id', mixed $value = null, mixed $obj = OBJECT, boolean $params = array()) : mixed
Method hook_get_wp_client_by()
Handle get wp client by.
string | $by | by. |
mixed | $value | by value. |
mixed | $obj | Format data. |
boolean | $params | Others params. |
$result results.
None found |
hook_get_activation_info(boolean $boolean, string $ext_slug)
Method hook_get_activation_info()
Get extension activation info.
boolean | $boolean | Input bool value. |
string | $ext_slug | extension api slug. |
None found |
None found |
hook_run_dashboard_action(boolean $boolean, string $action, boolean $out_die = false) : mixed
Method hook_run_dashboard_action().
Handle run dashboard action.
boolean | $boolean | Input bool value. |
string | $action | The action to run. |
boolean | $out_die | The function die or return. |
$return result.
None found |
hook_master_api_key_check() : array
Method hook_master_api_key_check().
Handle to valid MainWP API key.
$return Data.
None found |
hook_get_key_value(boolean $input_value, string $name, mixed $default_value = false) : array
Method hook_get_key_value().
Handle get key value.
boolean | $input_value | Boolean value, it should always be FALSE. |
string | $name | Key option name. |
mixed | $default_value | default value. |
$return Decrypted Key value.
None found |
hook_update_key_value(boolean $input_value, string $name, mixed $value = false, string $prefix = 'ext_') : array
Method hook_update_key_value().
Handle update key value.
boolean | $input_value | Boolean value, it should always be FALSE. |
string | $name | Key option name. |
mixed | $value | Key value. |
string | $prefix | prefix of key file name. |
$return Decrypted Key value.
None found |
hook_delete_key_value(string $name) : mixed
Method hook_delete_key_value().
Handle delete key value.
string | $name | Key option name. |
Return Result.
None found |
hook_encrypt_key_value(boolean $input_value, array $data, mixed $prefix = 'ext_', mixed $key_file = false) : array
Method hook_encrypt_key_value().
Handle get key value.
boolean | $input_value | Boolean value, it should always be FALSE. |
array | $data | Encrypted data. |
mixed | $prefix | prefix value. |
mixed | $key_file | Key file value. |
$return Decrypted Key value.
None found |
hook_decrypt_key_value(boolean $input_value, array $encrypted_data, mixed $default_value = false) : array
Method hook_decrypt_key_value().
Handle get key value.
boolean | $input_value | Boolean value, it should always be FALSE. |
array | $encrypted_data | Encrypted data. |
mixed | $default_value | default value. |
$return Decrypted Key value.
None found |
hook_delete_key_file(string $key_file) : array
Method hook_delete_key_file().
Handle delete key value.
string | $key_file | Key file name. |
$return Decrypted Key value.
None found |