Skip to content
Docs
Get RestroPress

Action

rpress_post_insert_log

Updated
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#

ParameterTypeDescription
$log_idintID of the new log entry.
$log_dataarrayLog entry data as passed to insert_log().
$log_metaarrayLog 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), in RPRESS_Logging::insert_log()

See also#

Was this page helpful?