Skip Navigation

Fully Integrated Themes + Layouts break password protection on Pages

Resolved

Reported for: Toolset Layouts 2.2

Resolved in: 2.3

Symptoms

Password-protected Pages are displayed without requiring the password when the following conditions exist:
– The Toolset Starter theme, Toolset Starter child theme or any fully integrated Theme is active
– A Page is password-protected
– A template layout has been applied to the page

Workaround

This will be addressed in a future Toolset release, but there is a workaround available.

Use conditional HTML to show or hide the protected page’s content depending on the use of a URL parameter.

For example, if the link to the page is,yoursite.com/protected-page then the page content will only appear if the user visits the page with the proper URL parameter like yoursite.com/protected-page?pass=123456. Instead of providing your users with passwords, you can provide them with the full URL.

Add the following code to your child theme’s functions.php file:

add_shortcode( 'custom-post-param', 'custom_post_param_shortcode' );
 
function custom_post_param_shortcode( $atts ) {
  if ( !empty( $atts['var'] ) ) {
    $var = (array)$_GET[$atts['var']];
    return esc_html( implode( ', ', $var ) );
  }
}

Go to the Toolset -> Settings page and click the Front-end Content tab. There, add custom-post-param in the Third-party shortcode arguments section.

Finally, apply the conditional HTML like this (replace “123456” with an actual “password” of your choice):


Comments are closed