Action
rpress_pre_insert_log
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#
| Parameter | Type | Description |
|---|---|---|
$log_data | array | Log entry data as passed to insert_log(), for example post_title, post_content, post_parent and log_type. |
$log_meta | array | Log 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), inRPRESS_Logging::insert_log()
See also#
Was this page helpful?
