From c846d4e27971c138f1425f8c7ff5422f8be84319 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 23 May 2017 13:03:07 -0400 Subject: [PATCH] Update private password login form Adding http referrer for https to http login page to work. --- functions.php | 20 ++++++++++++++++++++ style.css | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 71b92cc..59243a8 100644 --- a/functions.php +++ b/functions.php @@ -402,4 +402,24 @@ function post_pw_sess_expire() { } } } +/** + * Add a redirect field for password protect forms when + * HTTP_REFERER isn't set + * + * @access public + * @param string $form_html + * @return string + */ +public function wpa_add__wp_http_referer( $form_html ) { + if ( empty( $_SERVER['HTTP_REFERER'] ) ) { + $form_html = str_ireplace( + '', + '', + $form_html + ); + } + + return $form_html; +} +add_filter( 'the_password_form', array( $this, 'wpa_add__wp_http_referer' ), 10, 1 ); ?> diff --git a/style.css b/style.css index ea069ba..0757bcc 100644 --- a/style.css +++ b/style.css @@ -3,5 +3,5 @@ Theme Name: GreatLakesShipwreckMuseum Author: Gaslight Media Author URI: http://www.gaslightmedia.com Description: A theme for GreatLakesShipwreckMuseum -Version: 1.0.18 +Version: 1.0.19 */ -- 2.17.1