Skip to content

Commit

Permalink
Merge pull request #1501 from rizaardiyanto1412/development
Browse files Browse the repository at this point in the history
Add First Name and Last Name on Notification Shortcode
  • Loading branch information
olatechpro authored Dec 14, 2023
2 parents 4c28c3a + a1defbd commit f4141f9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Notifications/Shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ protected function get_actor()
* - login
* - url
* - display_name
* - first_name
* - last_name
* - email
* - separator
*
Expand Down Expand Up @@ -185,6 +187,14 @@ private function get_user_field($user, $field, $attrs)
$result = $user->display_name;
break;

case 'first_name':
$result = $user->first_name;
break;

case 'last_name':
$result = $user->last_name;
break;

case 'email':
$result = $user->user_email;
break;
Expand Down
2 changes: 2 additions & 0 deletions modules/improved-notifications/improved-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -903,6 +903,8 @@ private function getShortcodeActorFields()
'login',
'url',
'display_name',
'first_name',
'last_name',
'email',
]
);
Expand Down

0 comments on commit f4141f9

Please sign in to comment.