Making WordPress.org

Changeset 12107


Ignore:
Timestamp:
10/07/2022 06:20:28 AM (19 months ago)
Author:
coffee2code
Message:

Photo Directory, Moderation/Rejection: Email contributor of published photo if the photo has subsequently been rejected.

The email is identical to a rejection email but with a line added "Though this photo had already been approved, we have since decided to decline it and have unpublished it from the site.". As such, a required rejection reason and optional mod note to user will be included.

Props topher1kenobe, coffee2code.
Fixes #6365.

Location:
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php

    r12057 r12107  
    309309        }
    310310
    311         // Bail if user has already been emailed.
    312         if  ( self::has_user_been_emailed( $post ) ) {
    313             return;
    314         }
    315 
    316311        $user = get_user_by( 'id', $post->post_author );
    317312
    318313        $rejection_message = '';
     314
     315        // Add verbiage to acknowledge if photo was previously published prior
     316        // to its rejection.
     317        if ( self::has_user_been_emailed( $post ) ) {
     318            $rejection_message .= __( 'Though this photo had already been approved, we have since decided to decline it and have unpublished it from the site.', 'wporg-photos' ) . "\n";
     319        } else {
     320            $rejection_message .= __( 'The photo has been declined and will not be published to the site.', 'wporg-photos' ) . "\n";
     321        }
    319322
    320323        // Check for specifics provided by the moderator regarding the rejection.
     
    352355Thank you for submitting a photo to the WordPress Photo Directory.
    353356
    354 The photo has been declined and will not be published to the site.
    355357%2$s
    356358Submission date: %3$s
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/rejection.php

    r11686 r12107  
    848848        echo '<label for="moderator_note_to_user">' . __( '(Optional) Note to user:', 'wporg-photos' );
    849849        echo '<p class="description"><em>' . __( 'Included in approval/rejection email.', 'wporg-photos' ) . '</em></p>';
    850         // Currently no email is sent if photo changes state from being published, so don't allow the field to be set.
    851         $is_note_to_user_disabled = $is_disabled || ( 'publish' === get_post_status( $post ) );
    852         echo '<textarea id="moderator_note_to_user" name="moderator_note_to_user" rows="4"' . disabled( true, $is_note_to_user_disabled, false ) . '>';
     850        echo '<textarea id="moderator_note_to_user" name="moderator_note_to_user" rows="4"' . disabled( true, $is_disabled, false ) . '>';
    853851        echo esc_textarea( self::get_moderator_note_to_user( $post ) );
    854852        echo '</textarea>';
Note: See TracChangeset for help on using the changeset viewer.