Action
rpress_post_insert_log
On this page
Fires after a log entry has been inserted.
Runs at the end of RPRESS_Logging::insert_log(), after the post, the log type term and the log meta have been saved. The log ID comes from wp_insert_post(), so it can be 0 if the insert failed.
Parameters#
| Parameter | Type | Description |
|---|---|---|
$log_id | int | ID of the new log entry. |
$log_data | array | Log entry data as passed to insert_log(). |
$log_meta | array | Log meta key and value pairs. |
Example#
function my_after_insert_log( $log_id, $log_data, $log_meta ) {
if ( ! empty( $log_data['log_type'] ) && 'gateway_error' === $log_data['log_type'] ) {
error_log( 'Gateway error logged as #' . $log_id );
}
}
add_action( 'rpress_post_insert_log', 'my_after_insert_log', 10, 3 );
Source#
Fired from:
includes/class-rpress-logging.php(line 177), inRPRESS_Logging::insert_log()
See also#
Was this page helpful?
