Rule of thumb is do not modify any core WordPress files. Those in the root, wp-includes, wp-admin. You could do this easily with JavaScript:
/**
* Move the 'Collapse menu' item to the top of the admin menu
*
* @return void
*/
function wpse348570_move_collapse_menu() {
?>
<script>
if( jQuery( '#collapse-menu' ).length ) {
jQuery( '#collapse-menu' ).prependTo( '#adminmenu' );
}
</script>
<?php
}
add_action( 'admin_footer', 'wpse348570_move_collapse_menu' );
You can add the above as a plugin or place it into the child theme.
Related Posts:
- How do I Enqueue styles/scripts on Certain /wp-admin Pages?
- Changing Admin Menu Labels
- Is there ANY way to remove comments function and section totally?
- Add “external” link to admin menu in the backend
- How to add custom submenu links in wp-admin menus?
- Edit specific nodes in WP_Admin_Bar
- How to add notification bubble for my custom admin menu page
- How to create sub menu with a URL parameter?
- Adding a menu item in the admin bar
- How to remove items from +New admin menu?
- Reorder custom submenu item
- Make sub menu items a main link in the admin menu using fuctions.php
- Add column to pages table
- Admin account only shows Profile and Dashboard with no activity
- How to wrap admin menus and menu headers in additional divs without modifying the WordPress core?
- How to disable admin flyout menus?
- remove plugin admin menu in wordpress without installing plugin in v3.8.1
- How to prevent parent admin page from appearring as a child admin page
- Rename W3 Total Cache admin menu
- Remove query var on admin pages when ‘Save changes’ pressed
- Create a admin page in wordpress without admin menus (“wordpress sidebars”)
- Remove All in One Pack from the admin bar
- Cannot find an OLD Gravity Form on an OLD Word Press site [closed]
- wrapping ‘rest_api_init’ in ‘is_admin()’ function
- Add column to pages table
- Add menu option to “New Post” menu in admin bar
- Admin menu in front-end
- Remove or move admin submenus under a new menu
- How to get specific page screen ID
- Removing Dashboard Menu Items Through The Database
- WordPress Side Menu Admin Panel Default Order numbers List?
- load-{$page hook} and returned parameter
- Hide admin menu on update_option
- meta box on new admin page
- How to hide Admin Tabs? [duplicate]
- Making Comments, a sub_menu in admin menu
- Admin top level menu, pointing to an external url
- How to break line / add to ADMIN menu
- Creating custom admin panel pages without making a plugin?
- Change users.php WP_User_Query
- How can I control which plugins run in the dashboard?
- how to stop wordpress admin menu from scrolling with page
- Trying to create a page as a menu item in the admin while keeping the admen panel visible
- Custom admin menu order fails if slugs are complicated
- WordPress Admin Panel Left Sidebar No showing on Post create page
- Weird white space in admin area
- Redirect from wp-admin back to page
- Appearance -> Menus doesn’t show
- restrict admin panel sections to users
- Remove menu item dashboard for a unique user
- How to display status messages in admin panel
- adding existing menu page on new customer user role
- Disable flyout (popup) menus in backend
- Remove Theme menu link from Admin Panel
- Remove capability to interact with a page
- Redirection to external site on admin
- Move Custom Taxonomy Menu to Top Level Admin Menu
- get_current_screen() does not return parent_file
- How can we make managing lots of pages in WordPress Admin better?
- Disable image attachment links
- Remove “Time to upgrade” message from dashboard
- Looking for a hook to add attachment information to the media library tab
- How to move wp-admin login page to another location? [closed]
- WP-admin giving 404
- Getting post meta data, while editing a post in wp-admin panel [closed]
- Add custom text to Page Tamplate without need to know html
- Move WP Admin Bar
- Get Stylesheet To Showup in WP Admin Panel Editor
- Just how ‘expensive’ is this function?
- admin_url in plugins
- Where did the screen options menu go?
- How do I change the upload file size limit in single-site wordpress install?
- Can’t call external stylesheet for WordPress admin (using wp_admin_css)?
- Restore a layout [closed]
- Logging into sandbox subdomain WP
- Page update through theme editor caused wp admin to break
- White screen of death on admin and other dashboard pages
- Can I hook into wp_update_core outside of the admin?
- Renaming wp-admin without hard-coding it. Is it really possible?
- Why can I log into wp-login.php and not wp-admin.php?
- add_submenu_page() issue
- Unable to properly login
- Is there a simple way to set wordpress site files back to out of the box?
- How to check if it’s edit.php & post_type is set?
- Dashboard : remove Safari navigator message
- Contextual help in wp-admin for non admins
- How to add text editor in plugin menu?
- Step by step guide for new users on how to post content?
- How can I trigger a javascript function after a post update on edit post screen in wordpress admin panel?
- how to set not to be logined in wp-admin except administrator?
- WordPress, content editor default type
- Random HTTPs redirections at admin area in shared hosting
- WordPress Login for multiple sites
- wp_is_mobile() inside js
- Blank sign in page
- Action for opening edit page in admin?
- Is it possible to tell if a user is logged into WordPress from looking at the cookies which are set?
- After Upgrade: $user becomes unknown (id: 0) after successful login?
- jQuery datepicker not showing on admin menu
- Redirect users based on their roles, is_admin()