Changeset 13204
- Timestamp:
- 02/12/2024 08:24:36 PM (16 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/assets/js/admin.js
r12958 r13204 1 1 document.addEventListener('DOMContentLoaded', function () { 2 // Move the 'current' menu class to the link to a post status specific menu link if appropriate. 3 const searchParams = new URLSearchParams(document.location.search); 4 if (window.location.pathname.endsWith('edit.php') && searchParams.has('post_status')) { 5 const linkToPostStatus = document.querySelector('.wp-submenu a[href="edit.php?post_type=' + searchParams.get('post_type') + '&post_status=' + searchParams.get('post_status') + '"]'); 6 if (linkToPostStatus) { 7 // Remove existing 'current' classes. 8 document.querySelectorAll('.wp-submenu .current').forEach( n => n.classList.remove('current') ); 9 // Assign 'current' class to new menu item and link. 10 linkToPostStatus.classList.add('current'); 11 linkToPostStatus.parentElement?.classList.add('current'); 12 } 13 } 14 2 15 // Convert Orientations taxonomy checkboxes to radio buttons. 3 16 document.querySelectorAll('#photo_orientationchecklist input[type="checkbox"]').forEach((item) => {item.setAttribute('type', 'radio');});
Note: See TracChangeset
for help on using the changeset viewer.