Making WordPress.org

Changeset 12779


Ignore:
Timestamp:
08/01/2023 10:27:54 PM (3 years ago)
Author:
coffee2code
Message:

Photo Directory, Admin CSS/JS: Remove the "+ New {term}" links for custom taxonomies when editing a photo.

Category, color, and orientation terms are pre-configured and shouldn't be added on the fly. They can be added from the custom taxonomy management pages.

See #7171.

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

Legend:

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

    r12778 r12779  
    6767
    6868body.post-type-photo label[for="authordiv-hide"],
    69 body.post-type-photo #authordiv {
     69body.post-type-photo #authordiv,
     70#photo_category-adder,
     71#photo_color-adder,
     72#photo_orientation-adder {
    7073        display: none;
    7174}
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/js/admin.js

    r12775 r12779  
    2323                document.getElementById('photo_orientationdiv').hidden = true;
    2424        }
     25
     26        // Remove a number of interface elements.
     27        const interfaceElementsToRemove = [
     28                '#photo_category-adder',
     29                '#photo_color-adder',
     30                '#photo_orientation-adder',
     31        ];
     32        interfaceElementsToRemove.forEach(n => { document.querySelector(n)?.remove(); });
    2533
    2634        // Highlight custom taxonomies lacking terms.
Note: See TracChangeset for help on using the changeset viewer.