From ba226b62d637939822947d2a7cd1b276368c4573 Mon Sep 17 00:00:00 2001 From: Matt Miller Date: Fri, 5 Oct 2018 10:44:55 -0700 Subject: [PATCH] 1.2.3 - Parent post password bug fix --- index.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.php b/index.php index 64f0f9f..c56bcf4 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ /** * Plugin Name: Protect the Children! * Description: Easily password protect the child pages/posts of a post that is password protected. - * Version: 1.2.2 + * Version: 1.2.3 * Author: Miller Media (Matt Miller) * Author URI: www.millermedia.io */ @@ -42,7 +42,8 @@ if (!$parent_post) return; - $parent_password = $parent_post->post_password; + $parent_post_object = is_int($parent_post) ? get_post($parent_post) : $parent_post; + $parent_password = $parent_post_object->post_password; // Check the cookie (hashed password) require_once ABSPATH . WPINC . '/class-phpass.php';