Forked from cliffordp/pagelines-dms-force-ssl-https-wp-engine.php
Created
October 16, 2013 09:56
-
-
Save Bicarbona/7005427 to your computer and use it in GitHub Desktop.
This file contains 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 | |
/* | |
Plugin Name: PageLines DMS Force SSL/HTTPS | |
Author: TourKick (Clifford P) | |
Author URI: http://tourkick.com/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl | |
Plugin URI: http://www.pagelinestheme.com/pagelines-dms-ssl-https-wp-engine/?utm_source=pagelines&utm_medium=plugin&utm_content=pluginuri&utm_campaign=dmsforcessl | |
Description: Force PageLines DMS SSL/HTTPS. <a href="http://www.pagelinestheme.com/pagelines-dms-ssl-https-wp-engine/" target="_blank">http://www.pagelinestheme.com/pagelines-dms-ssl-https-wp-engine/</a> may also be helpful. | |
License: GPLv2 | |
Version: 1.0.20131015 | |
*/ | |
if( defined('WP_SITEURL') // or could use DOMAIN_CURRENT_SITE for Multisite -- if changed, change in both places | |
&& preg_match('/.staging.wpengine.com$/', constant('WP_SITEURL')) ) {} else { | |
// Force PL SSL if not WP Engine Staging Site | |
add_action( 'pl_force_ssl', '__return_true' ); | |
add_filter( 'pless_vars', 'make_ssl_vars' ); | |
function make_ssl_vars( $vars ) { | |
$vars['plSectionsRoot'] = str_replace( 'http://', 'https://', $vars['plSectionsRoot'] ); | |
$vars['plRoot'] = str_replace( 'http://', 'https://', $vars['plRoot'] ); | |
return $vars; | |
} | |
// If PL DMS Editor won't save changes on a site with SSL // https://github.com/pagelines/DMS/blob/Dev/editor/editor.actions.php#L6 | |
// don't add unless you absolutely need to | |
// add_action('wp_ajax_nopriv_pl_editor_actions', 'pl_editor_actions'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment