Last active
February 5, 2021 03:15
-
-
Save harisrozak/7580d035c0254224ccc9384b9081c64f to your computer and use it in GitHub Desktop.
WordPress Fix `rest_url` that isn't become https on certain server
This file contains hidden or 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 | |
add_filter( 'rest_url', function( $url ) { | |
if ( is_ssl() ) { | |
$url = set_url_scheme( $url, 'https' ); | |
return $url; | |
} | |
return $url; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Related discussion: https://core.trac.wordpress.org/ticket/36451