List of hooks in the WP Security Audit Log plugin

You are here:
Back

Hooks in the WP Security Audit Log plugin allow you to hook into the plugin’s functionality to modify it’s behaviour. This article contains a list of hooks and parameters found in the WP Security Audit Log plugin.

Index of Hooks:

Audit Log Data Hooks

wsal_auditlog_row_user_data

Function

This filter hook runs before displaying the user data of an event on the audit log view. It can be used to filter the user data of each event being displayed on the audit log view.

Parameters

  • $row_user_data – User data to display in the audit log row
  • $event_db_id – Event database ID

Example Code

wsal_event_data_before_log

Function

This filter hook runs before saving an event in the audit log database. It can be used to filter the event data of a filter and take action accordingly.

Parameters

  • $event_id – Event ID
  • $event_data – Array of event data

Example Code

wsal_event_id_before_log

Function

This filter hook runs before saving an event in the audit log database. It can be used to detect event ids and take the required action.

Parameters

  • $event_id – Event ID
  • $event_data – Array of event data

Example Code

wsal_post_meta_updated

Function

This hook runs before the logging of post meta update events, such as event ID 2062 and 2054 (refer to the complete list of WordPress activity log event IDs for more details). This hook can be used to log events of updated post meta from the front-end, since the plugin only keeps a log of post meta updates done via the WordPress admin pages.

Parameters

  • $meta_id – Unique ID of the meta data.
  • $object_id – Post ID to which the meta data belongs to.
  • $old_meta – Array of the meta data containing key & values of old meta data before it is updated.
  • $meta_key – Key of the meta data being updated.
  • $meta_value – Value of the meta data being updated.

Example Code

A general example code which shows how to log a meta data updated event in the WP Security Audit Log plugin.

Plugin Settings Hooks

wsal_log_hidden_meta_keys

Function

By default hidden meta keys (custom fields) are ignored by the WP Security Audit Log plugin. The names of these meta keys start with an underscore and are typically used to store posts’ settings. This filter hook allow users to specify an array of hidden meta keys for which the plugin should keep a log of when they or the values they store change.

Parameter

  • $meta_keys — Array of hidden post meta keys.

Example Code

wsal_infinite_scroll_events

Function

This hook can be used to change the number of events that are shown by default in the audit log viewer when using the infinite scroll view mode.

Parameter

  • return – specify the number of events

Example Code

Login Prompt Plugin Hooks

wsal_override_session_block_message

Function

This hook filters the message displayed to users when they try to login and their session is blocked because multiple sessions are not allowed.

Parameter

  • $message — Override session block message.

Example Code

wsal_override_session_password_field

Function

This hook filters the override session password field displayed to users when their session is blocked and are asked to enter the override password.

Parameter

  • $password_field — Override password field.

Example Code

wsal_override_session_password_field_tags

Function

This hook filters the override session password field tags so that they can be displayed using wp_kses function.

Parameter

  • $allowed_html_tags — Override password field HTML tags.

Example Code