Making WordPress.org

Changeset 14051


Ignore:
Timestamp:
09/12/2024 09:04:57 PM (5 months ago)
Author:
coffee2code
Message:

Photo Directory, Rejection: Unset rejection-related changes if "Allow rejection of published photo?" gets unchecked.

A moderator might reasonably assume that unchecking the checkbox should prevent any efforts they made to reject the photo to be ignored.

See #7751.

File:
1 edited

Legend:

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

    r13996 r14051  
    858858                cbRejectPublished?.addEventListener('change', (event) => {
    859859                    if (rejectSelect) {
     860                        // If disabled, then undo any changes towards doing the rejection.
     861                        if ( !event.target.checked ) {
     862                            const inputRejectNoteToUser = document.querySelector('#moderator_note_to_user');
     863                            // Remove rejection note to user.
     864                            inputRejectNoteToUser.value = '';
     865                            // Unset rejection reason.
     866                            rejectSelect.value = '';
     867                            rejectSelect.dispatchEvent(new Event('change'));
     868                        }
     869                        // Disable rejection dropdown.
    860870                        rejectSelect.disabled = !event.target.checked;
    861871                    }
     
    869879JS;
    870880
    871         // Show a notice if the post is already published and a checkbox for enabling rejection field.
     881        // Show a notice if the post is already published and add a checkbox for enabling rejection field.
    872882        if ( 'publish' === get_post_status( $post ) ) {
    873883            echo '<div class="reject-warn-if-published">';
Note: See TracChangeset for help on using the changeset viewer.