Created
October 1, 2023 00:57
-
-
Save wpeasy/2b740b14721f00516fc7e6aa0614e283 to your computer and use it in GitHub Desktop.
Grouping WordPress CPTs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#adminmenu [id*="menu-posts-"]{ | |
background-color: var(--bricks-color-primary); | |
} | |
#adminmenu [id*=menu-posts-] > a { | |
color: black; | |
} | |
#adminmenu [id*=menu-posts-] > a .wp-menu-image::before{ | |
color: black; | |
} | |
/* CPT Label */ | |
#adminmenu li.cpt-menu { | |
padding: 0.25rem ; | |
display: block; | |
border: 1px solid rgba(255,255,255,.4); | |
border-radius: 30px; | |
color: #ffffffbb; | |
margin: 0.25rem ; | |
line-height: 1; | |
font-size: 10px; | |
font-weight: bold; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(()=>{ | |
const myItems = document.querySelectorAll('[id*="menu-posts-"]'); | |
const li = document.createElement("li"); | |
li.textContent = 'Custom Post Types'; | |
li.classList.add('cpt-menu'); | |
const parent = myItems[0].parentNode; | |
parent.insertBefore(li, myItems[0]); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment