Skip to content
Docs
Get RestroPress

Action

rpress_pre_insert_log

Updated
On this page

Fires before a log entry is inserted.

Runs in RPRESS_Logging::insert_log() before wp_insert_post() is called. The data is the array passed by the caller, not the version merged with the defaults.

Parameters#

ParameterTypeDescription
$log_dataarrayLog entry data as passed to insert_log(), for example post_title, post_content, post_parent and log_type.
$log_metaarrayLog meta key and value pairs. Keys are stored with the _rpress_log_ prefix.

Example#

function my_before_insert_log( $log_data, $log_meta ) {
	error_log( 'Inserting log: ' . ( $log_data['post_title'] ?? '' ) );
}
add_action( 'rpress_pre_insert_log', 'my_before_insert_log', 10, 2 );

Source#

Fired from:

  • includes/class-rpress-logging.php (line 164), in RPRESS_Logging::insert_log()

See also#

Was this page helpful?