Making WordPress.org

Changeset 12774


Ignore:
Timestamp:
08/01/2023 10:15:05 PM (19 months ago)
Author:
coffee2code
Message:

Photo Directory, Admin JS: Hide 'Orientations' metabox via JS when a value is assigned.

This is reliably auto-assigned and should never need changing once assigned.

See #7171.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/js/admin.js

    r12773 r12774  
    1212
    1313    // Hide 'Post submitted' admin notice if post publication was actually blocked due to missing taxonomies.
    14     document.querySelector('.notice-missing-taxonomies ~ #message.notice-success')?.hidden = true;
     14    const successNoticeAlongsideMissingTerms = document.querySelector('.notice-missing-taxonomies ~ #message.notice-success');
     15    if (successNoticeAlongsideMissingTerms) {
     16        successNoticeAlongsideMissingTerms.hidden = true;
     17    }
     18
     19    // Hide 'Orientations' metabox when a value is assigned.
     20    //  Orientation shouldn't need direct assignment or changing, so don't show it (as long as a value was set).
     21    const orientation_value = document.querySelector('input[name="tax_input[photo_orientation][]"]:checked' );
     22    if ( orientation_value ) {
     23        document.getElementById('photo_orientationdiv').hidden = true;
     24    }
    1525}, false);
Note: See TracChangeset for help on using the changeset viewer.