Contributors: Return default array when posts empty to avoid notices.

Previously there were `undefined index` notices on `wp-admin/edit.php?post_type=5ftf_pledge` when a pledge had `0` posts in either status.
This commit is contained in:
Ian Dunn 2019-11-07 15:37:01 -08:00
parent 93d2bafd34
commit 521ce58de7
No known key found for this signature in database
GPG key ID: 99B971B50343CBCB
2 changed files with 13 additions and 5 deletions

View file

@ -119,6 +119,10 @@ function add_log_entry( $pledge_id, $type, $message, array $data = array(), $use
$entry['user_id'] = $user_id;
} elseif ( 'cli' === php_sapi_name() ) {
/*
* `wp_shell`, etc can only be run from w.org sandboxes, and the hostname is the best way to identify
* which sandbox was used.
*/
$entry['user_id'] = gethostname();
}