Skip to content

Instantly share code, notes, and snippets.

View krunalsojitra's full-sized avatar

krunalsojitra

View GitHub Profile
@krunalsojitra
krunalsojitra / force-ssl-url-scheme.php
Last active April 3, 2017 06:44 — forked from webaware/force-ssl-url-scheme.php
Add into WordPress plugins folder on your website, then activate it in the Plugins admin
<?php
/*
Plugin Name: Force SSL URL Scheme
Plugin URI: https://gist.github.com/webaware/4688802
Description: Force the protocol scheme to be HTTPS when is_ssl() doesn't work
Version: 1.0.0
Author: WebAware
Author URI: http://webaware.com.au/
@ref: http://wordpress.org/support/topic/ssl-insecure-needs-35-compatibility
<?php
if( ! empty( $_FILES ) ) {
foreach( $_FILES as $file ) {
if( is_array( $file ) ) {
$attachment_id = upload_user_file( $file );
}
}
}
?>