Just how ‘expensive’ is this function?

rule of thumb, never do anything that results in DB write from the front end. Even better if you can create an admin page in which the operation is triggered (even if it just starts an AJAx based process). Your problem here is with hooking on an inappropriate hook. You hooked on init which means … Read more

How to change menu icon which is overriden (i.e. by WooCommerce) [closed]

WooCommerce styles the icon via this CSS file: woocommerce/assets/css/menu.css, and here’s the corresponding code (pretty-printed or actually, I copied it from woocommerce/assets/css/menu.scss): #adminmenu #toplevel_page_woocommerce .menu-icon-generic div.wp-menu-image::before { font-family: ‘WooCommerce’ !important; content: ‘\e03d’; } So you can change the font-family and the content (and other) properties to suit your custom icon. Below is an example of … Read more