This is hardcoded and cannot be changed, the first sidebar box is the only one that doesn’t receives a closed
CSS class.
You’d have to use jQuery to do it:
add_action( 'admin_footer-widgets.php', function(){
?>
<script type="text/javascript">
jQuery(document).ready(function($) {
$('#widgets-right .widgets-holder-wrap:first').addClass('closed');
});
</script>
<?php
});
There’s a small glitch because the box appears opened at first until the jQuery is applied. It can be smoothed with:
add_action( 'admin_head-widgets.php', function(){
echo '<style type="text/css">#widgets-right {display:none}</style>';
});
And adding $('#widgets-right').show('slow');
just after the addClass
.
Related Posts:
- Modify CSS via Theme Control Panel
- Display an image of selected template in admin to aid user when using complex templates
- Add custom column to Users admin panel
- Modal window from within WordPress admin
- How do I remove dashboard access from specific user roles?
- Search posts by ID in admin
- Sort pages in loop by admin’s page attributes order field?
- Edit “thank you for creating with WordPress” in version 3.3.1
- How to save dismissable notice state in WP 4.2?
- Notification that the admin is online
- Plugin to remove Admin menu items based on user role?
- How to obtain the user ID of the current profile being edited in WP-Admin?
- Get current active wp color scheme
- Cannot login to WordPress Admin with SSL terminated load balancer
- How to fix admin stylesheet muck-up? [closed]
- Turn off admin emails for new user registrations
- Remove admin AND editor from the “change role to” menu in user listing
- Adding custom Javascript to the head tag in Admin
- Making Media Library “Alternative Text” Field Required
- Add extra field when admin create user
- Replacing the List table of a Post Type
- WordPress Left Hand Side Admin Menu Always Collapsed
- changing body background color for custom post type in admin backend
- Adding scripts to admin page in my theme
- How can I place the “Add New Post” contents on a custom page?
- Use latest jQuery in WordPress (admin interface)
- Remove default WordPress styling from metaboxes on edit post pages?
- Getting Rid of the WordPress.com Toolbar on Other Sites?
- Any way to inherit methods from both my plugin class and WP_List_Class?
- How to notify the admin about something that happened during a cron job
- wp_dropdown_pages() in theme admin page
- How to enable enqueue_script to work with a logged in user?
- I’m receiving requests to change the admin email. How can this be happening?
- How can I load an inline script after the enqueued scripts in admin?
- Set admin body to ltr on a rtl installation
- Restore original WP admin bar after BuddyPress install [closed]
- front end editing using iFrames, best approach?
- Are there any filters to add additional columns to the list table on edit-comments.php?
- Can I mass change all admin emails for a multisite instance?
- WordPress Frontend Check If Current User Is Administrator
- Instructions for a custom post type
- WordPress admin area used to administer other site
- Can’t access dashboard as administrator, login as any other level works though
- Problems with WP_List_Table and hooks
- Add ‘Last Modified’ and Attachments (Yes/No) to WordPress Users Column
- Dashicons and Pseudo :before
- WordPress administrator area access disabled temporarily due to widespread brute force attacks
- Modifying the built-in behavior of ajax tag type-ahead functionality of WordPress
- Why am I timing out when using the Menu Editor?
- Hide admin toolbar based on a query string
- How can I merge two authors?
- Why can’t a custom postype be registered with “admin_init” hook?
- Remove Permalink From Admin Edit Post
- When submitting the form site.com/blog/wp-admin it goes to site.com/wp-admin
- How can I POST or GET to the same admin page from which I am POST-ing or GET-ing
- WordPress admin toolbar not loading styles after migration
- Access for adding subpages but not for pages
- remove menus for a specific role?
- Post editor is 89953px tall. How to fix?
- How can I add a menu item to the admin area?
- I’m a super admin and I want to give an admin the ability to add new users…?
- Return User Meta text as links to post edit inside the user columns
- Order All Pages table in administration
- WordPress Admin Menu Order for ‘admin.php’ pages
- Show global Message in User Profiles with admin only Input field in WordPress Backend
- Is there a filter to remove or replace the post title’s link in the admin post table view (edit.php)?
- How to pass a specific post id from “all posts” list in Admin panel
- How to change the link of the wordpress logo in the admin bar?
- How should I setup the “Users” area to hand over to a client?
- Shows site under construction but comes up after I login to admin
- Wp-Admin FTPS Connection Error unlike Filezilla
- Default scripts added to each admin page
- Settings API – Last two tabs not rendered separate
- Adding a WordPress Admin Dashboard to my local wordpress site
- cannot access the wordpress dashboard after changing the site url
- Reset WordPress admin users to limit access
- Is it possible to push admin notices to one specific user instead of all users?
- After upgrading to WP 5.1.1 sometimes I need to reauth infinitively
- Doesn’t call user information to include “wp-load.php” in an external php file
- Trying to hide a submenu link which is created by Co-authors Plus plugin
- Redirect non-admin after login, and in url – /admin
- Blank WordPress admin/dashboard (7 updates pending)
- How can I create multiple different admin roles with their own capabilities
- Find out if post was just updated on post edit screen
- Admin hook after editing an image?
- Wp-admin page not found following copy of site
- Custom redirection when managing users in admin
- How to retain HTML5 Attributes on Markup
- Why doesn’t the Media Browser use thumbnail sized images?
- wordpress login loop after install
- Improving this link color picker code
- Change Admin URL
- Change the Author name to a custom field?
- How to remove certain feed from my dashboard in WP admin
- Hiding the media-new.php File URL option via jQuery
- Buddypress send admin notification email when new subscriber registers
- Background image in login showing in admin area
- Filtered dropdown for author?
- Change order of the block editor’s panel
- Display admin sidebar into custom post pages if logged