Last active
December 15, 2021 18:19
-
-
Save userabuser/89580ef1c333359a47a802a965404d8e to your computer and use it in GitHub Desktop.
Add classes to add_submenu_item menu items in WordPress
Alternatively you can target the anchor href attribute using pure css alone:
ul.wp-submenu a[href^="options-general.php?page=my-submenu-menu-slug"]:before {
margin-right: 5px;
font-family: dashicons;
display: inline-block;
line-height: 1;
font-weight: 400;
font-style: normal;
speak: never;
text-decoration: inherit;
text-transform: none;
text-rendering: auto;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
width: 20px;
height: 20px;
font-size: 20px;
vertical-align: top;
text-align: center;
transition: color 0.1s ease-in;
content: "\f180";
}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output above..