-
-
Save Benunc/920f8c2eb09b9403d5dda2f778dc3ffc to your computer and use it in GitHub Desktop.
This file contains 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
<?php | |
//if you are pasting this code into a snippet plugin, most of them don't require the opening PHP tag above | |
add_filter( 'admin_body_class', 'body_class_user_role' ); | |
function body_class_user_role( $classes ) { | |
$current_user = get_current_user_id(); | |
if( is_user_logged_in() && $current_user === 564) { | |
$classes .= 'give-accountant'; | |
} | |
return $classes; | |
} | |
add_action('admin_head', 'my_custom_admin_style'); | |
function my_custom_admin_style() { | |
echo '<style> | |
.give-accountant a[href*="post-new.php"], | |
.give-accountant a[href*="media-new.php"], | |
.give-accountant #give-stripe-opt-refund-wrap, | |
.give-accountant a[href="edit.php?post_type=give_forms&page=give-settings"] { | |
display: none!important; | |
} | |
</style>'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment