If a user is not logged in then admin_head probably won’t run. So let’s just check their capabilities.
function my_custom_admin_head() {
if ( ! current_user_can( 'have-fun' )) :
?><style>
#welcome-panel{display: none !important;}
#wp-content-editor-tools{display: none !important;}
</style>
<?php endif; // cant' have-fun
}
add_action( 'admin_head', 'my_custom_admin_head' );
Related Posts:
- How do i use fontawesome icons in TinyMce editor?
- Gutenberg Block Editor Match Admin Styles & Frontend Styles
- Deregister CSS style link ‘open-sans-css’
- Different css rules for TinyMCE and Gutenberg while using add_editor_style()
- Load in wp admin assets from child theme
- Admin pages missing css
- How to enable table overflow scroll? (especially order list table)
- How to disable the hover effect in WordPress and Elementor?
- How to stop my themes CSS changing the WordPress interface/?
- dynamic css file for admin / backend and get_option results in Uncaught Error: Call to undefined function get_option()
- Apply custom css for user role
- Button doesn’t work in the profile panel
- ACF Gut block broke wordpress default style?
- WordPress Sudden Loss of All CSS And Tons of JQuery Errors
- How can I add a stylesheet to the Classic Editor page?
- Stop custom Gutenberg styles taking over other admin bits?
- Custom CSS based on the Author of a Post
- Admin bar default color scheme for nonregistered/nonlogged users
- Lines of CSS only being delivered while logged in
- Adding custom css to a theme depending on whether the admin user is logged in or not
- Change Login CSS – Include instead of echo
- custom css in admin panel by user id
- remove author and date from all posts [closed]
- Enqueue MCE Editor CSS in admin page
- Is there a CSS parent selector?
- How can I vertically center a “div” element for all browsers using CSS?
- How do I hide the bullets on my list for the sidebar?
- How to center HTML5 Videos?
- Text border using css (border around text)
- U8Qtu
- What is the difference between visibility:hidden and display:none?
- Center a position:fixed element
- How to change the background colour’s opacity in CSS
- difference between css height : 100% vs height : auto
- Using margin / padding to space span tag from the rest of the p tag
- Could the WP script/style loader be used to concatenate and gzip scripts and styles in the front-end?
- Style something only on the home page
- How do I register/enqueue a custom CSS file?
- Why isn’t my theme processing SASS?
- PageLines theme: how to change the background color of the main content vs. entire page?
- Changing CSS in Twenty Eleven to change font size of body text
- When using https, wordpress doesn’t use https for CSS and JS, and admin doesn’t work. How do I fix this?
- I want to change my post titles from h2 to H1
- Write text below a specific part of a sentence
- Style classic editor buttons
- Remove id attribute from stylesheet link
- Twig + wordpress – how to get filemtime for style.css
- Font embedding in wordpress
- How to Add Custom CSS to the Media Thickbox?
- Link theme options page using ACF to styles
- Does costum code in the root folder get lost when wordpress is updated?
- WordPress Light/Dark Theme best practices? Is there a way that really works?
- Changing CSS FilePath for All Pages
- wp_add_inline_style breaking style and not working
- How to add a custom CSS class to ALL links
- Background image reversed on pages after home page [closed]
- Why won’t my custom login page CSS load?
- How to apply CSS based on publishing date
- Remove CSS Attribute by Overriding CSS in Child Theme
- CSS gap issue in div element
- How to change the standard navigation menu color when using genesis [closed]
- How to add class to an html output element in tinyMCE paragraph drop down menu
- Add classes + taxonomy terms to wp_list_pages() output
- Chat window hiding behind Twenty Eleven header
- CSS isn’t rendered on a post but just posted as text [closed]
- How would I create the same popup in css and javascript as the one in contact button on the site https://www.sublimotionibiza.com/es/main.html [closed]
- How to use css only H2 Tag? Site is considering website title also H2 tag and changing its style as well
- How to edit CSS style sheet after migrating from local
- WordPress footer always at the bottom of the screen-page
- Dequeing Parent Fontawesome Deques Parent Styles
- WordPress childtheme not loading any CSS/SCSS
- Why can’t blocks be hidden with jQuery?
- CSS: Appearance/Customise display different to actual display
- Border around menu button [closed]
- Correct use of !important
- How to change hover link colour for blog post (body) text only
- Problems styling a Custom Link in a Menu
- Font .woff files loaded don’t correspond to the displayed styles [closed]
- Help locating old custom_css in PHP MyAdmin
- I would like to achieve a two column checkout page
- Twenty Fourteen: Shrinking header while scrolling down
- CSS ?ver=4.7.3 not found
- Custom CSS rules only apply to home page
- How would I add this code to a single WordPress page?
- How to enqueue google fonts if we use directly in style.css
- Trouble with adding preloader to my home page index.html and index.js
- How to change menu hover color to white on my theme? [closed]
- How to make CSS load live based on options clicked in the theme customizer?
- How can a left and right margin be added to the admin bar without access to “…wp-includes/admin-bar.php”?
- Inserting a DIV Block Into a Listing of Excerpts?
- WordPress Custom Superfish CSS Problem [closed]
- Do you use css reset in your child theme [closed]
- Is it possible to make invisible a div only on certain pages using CSS?
- why does WordPress custom css convert alpha to hex values?
- What CSS selectors to know for WordPress? [closed]
- Can I upload my HTML/CSS/Javascript game onto a WordPress page?
- How to add css to wp_head depending on the user role?
- WordPress site suddenly not showing some DOM elements but mobile is fine
- Editing size of h3 tag in wordpress on a one-off basis
- Content doesn’t fit on large size desktops like 2560×1440