Skip to content

Commit

Permalink
Email notification: new status labels weren't applied to message appr…
Browse files Browse the repository at this point in the history
…opriately

This corrects issues with sprintf() argument order, but also restructures the message due to awkward phrasing with new "Submitted Revision" terminology.
  • Loading branch information
agapetry committed Nov 8, 2021
1 parent 2afc931 commit e0a4d26
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions revision-workflow_rvy.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,23 +145,21 @@ function do_notifications( $notification_type, $status, $post_arr, $args ) {

if ( ( $admin_notify || $author_notify ) && $revision_id ) {
$type_obj = get_post_type_object( $object_type );
$type_caption = $type_obj->labels->singular_name;
$type_caption = strtolower($type_obj->labels->singular_name);
$post_arr['post_type'] = $published_post->post_type;

$blogname = wp_specialchars_decode( get_option('blogname'), ENT_QUOTES );

if (!empty($args['update'])) {
$title = sprintf( __('[%s] %s Updated', 'revisionary'), $blogname, pp_revisions_status_label('pending-revision', 'name') );

$message = sprintf( __('A %s to the %1$s "%2$s" has been updated.', 'revisionary'), strtolower(pp_revisions_status_label('pending-revision', 'name')), $type_caption, $post_arr['post_title'] ) . "\r\n\r\n";
$message = sprintf( __('%1$s updated a %2$s of the %3$s "%4$s".', 'revisionary'), $current_user->display_name, strtolower(pp_revisions_status_label('pending-revision', 'name')), $type_caption, $post_arr['post_title'] ) . "\r\n\r\n";
} else {
$title = sprintf( __('[%s] %s Submission', 'revisionary'), $blogname, pp_revisions_status_label('pending-revision', 'name') );
$title = sprintf( __('[%s] %s', 'revisionary'), $blogname, pp_revisions_status_label('pending-revision', 'name') );

$message = sprintf( __('A %s to the %1$s "%2$s" has been submitted.', 'revisionary'), strtolower(pp_revisions_status_label('pending-revision', 'name')), $type_caption, $post_arr['post_title'] ) . "\r\n\r\n";
$message = sprintf( __('%1$s submitted changes to the %2$s "%3$s". You can review the changes for possible publication:', 'revisionary'), $current_user->display_name, $type_caption, $post_arr['post_title'] ) . "\r\n\r\n";
}

$message .= sprintf( __('This operation was performed by %1$s.', 'revisionary' ), $current_user->display_name ) . "\r\n\r\n";

if ( $revision_id ) {
$revision = get_post($revision_id);

Expand Down

0 comments on commit e0a4d26

Please sign in to comment.