mirror of
https://github.com/WordPress/five-for-the-future.git
synced 2025-07-04 10:05:43 +03:00
Pledge Log: Log user of CLI actions.
This commit is contained in:
parent
c524d1b21b
commit
18228d367c
2 changed files with 11 additions and 3 deletions
|
@ -117,6 +117,9 @@ function add_log_entry( $pledge_id, $type, $message, array $data = array(), $use
|
|||
if ( $user_id ) {
|
||||
// The template defaults to the current user, so this function parameter shouldn't override unless it's different.
|
||||
$entry['user_id'] = $user_id;
|
||||
|
||||
} elseif ( 'cli' === php_sapi_name() ) {
|
||||
$entry['user_id'] = gethostname();
|
||||
}
|
||||
|
||||
add_post_meta( $pledge_id, LOG_META_KEY, $entry, false );
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue