Skip to content

Instantly share code, notes, and snippets.

@harisrozak
Last active February 5, 2021 03:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save harisrozak/7580d035c0254224ccc9384b9081c64f to your computer and use it in GitHub Desktop.
Save harisrozak/7580d035c0254224ccc9384b9081c64f to your computer and use it in GitHub Desktop.
WordPress Fix `rest_url` that isn't become https on certain server
<?php
add_filter( 'rest_url', function( $url ) {
if ( is_ssl() ) {
$url = set_url_scheme( $url, 'https' );
return $url;
}
return $url;
});
@harisrozak
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment