Skip to content

Commit

Permalink
Use unknown if user is undefined
Browse files Browse the repository at this point in the history
Co-authored-by: Bartosz Gadomski <[email protected]>
  • Loading branch information
delawski and bartoszgadomski authored Jul 15, 2024
1 parent c22e244 commit 46bb81b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion alerts/class-alert-type-email.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function alert( $record_id, $recordarr, $alert ) {
$user = get_user_by( 'id', $user_id );

// translators: Placeholder refers to a username (e.g. "administrator").
$message .= sprintf( __( "User:\t%s", 'stream' ), ! empty( $user->user_login ) ? $user->user_login : '' ) . "\n";
$message .= sprintf( __( "User:\t%s", 'stream' ), ! empty( $user->user_login ) ? $user->user_login : __( 'unknown', 'stream' ) ) . "\n";

if ( ! empty( $alert->alert_meta['trigger_context'] ) ) {
$context = $this->plugin->alerts->alert_triggers['context']->get_display_value( 'list_table', $alert );
Expand Down
2 changes: 1 addition & 1 deletion connectors/class-connector-acf.php
Original file line number Diff line number Diff line change
Expand Up @@ -614,7 +614,7 @@ public function check_meta_values( $type, $action, $meta_id, $object_id, $key, $
/* translators: %1$s: a field label, %2$s: an object title, %3$s: an object type (e.g. "Message", "Hello World", "post") */
esc_html_x( '"%1$s" of "%2$s" %3$s updated', 'acf', 'stream' ),
array(
'field_label' => ! empty( $cache['field']['label'] ) ? $cache['field']['label'] : '',
'field_label' => ! empty( $cache['field']['label'] ) ? $cache['field']['label'] : __( 'unknown', 'stream' ),
'title' => $title,
'singular_name' => $type_name,
'meta_value' => $value,
Expand Down

0 comments on commit 46bb81b

Please sign in to comment.