Skip to content

Instantly share code, notes, and snippets.

View willthemoor's full-sized avatar

Will Moore willthemoor

  • OHSU
  • Portland, OR
View GitHub Profile
// Add role class to body
function ns_add_role_to_body($classes) {
global $current_user;
$user_role = array_shift($current_user->roles);
// body classes are built differently on the front and back end.
// https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-admin/admin-header.php#L164
if ( ! is_admin() ) {
$classes[] = 'role-'. $user_role;
}
@willthemoor
willthemoor / lorem.jade
Last active June 30, 2018 14:03 — forked from geedmo/lorem.jade
Lorem Ipsum generator mixin for Jade (single paragraph)
//- ----------------------------------
//- Simplified version.
//-
//- Usage:
//- include lorem
//- p: +lipsum(42)
//- ----------------------------------
mixin capitalize(string)