How to load Dashboard default media files via HTTPS even when Browser AddressBar URL has HTTP
On all Admin Dashboard pages, I want to force the loading of all CSS, JS via https, even when URL in browser addressbar is using http.
Can this be done?
Currently, I have tried to hardcode in wp-login.php the default list of media files. This loads the hardcoded CSS/JS files via https even when its HTTP in Browser URL.
But, I cant go further into complex structure of wp-admin/ admin-header.php
I'm now looking into trying enqueue in my theme's function.php
/*Enqueue Admin CSS JS */
function wpdocs_selectively_enqueue_admin_script( $hook ) {
wp_enqueue_script( 'default1', '.php?c=0&dir=ltr&load%5B%5D=dashicons,admin-bar,wp-pointer,common,forms,admin-menu,dashboard,list-tables,edit,revisions,media,themes,about,nav-menus,widgets&load%5B%5D=,site-icon,l10n,buttons,wp-auth-check&ver=5.2.6', array(), '1.0' );
wp_enqueue_script( 'default2', '.css?ver=1591072501', array(), '1.0' );
wp_enqueue_script( 'default3', '.1587658822.css?ver=7.4.7', array(), '1.0' );
wp_enqueue_script( 'default4', '.1587658822.css?ver=7.4.7', array(), '1.0' );
}
add_action( 'admin_enqueue_scripts', 'wpdocs_selectively_enqueue_admin_script' );
PS: Media files discussed above are default System+Plugin CSS/JS files (and not custom css/js file)
PS: I dont want to force HTTPS in Browser AddressBar, only force HTTPS for the included media files.