Minor edit fixing MembOnly css applying
authorLaury GvR <laury@gaslightmedia.com>
Tue, 27 Sep 2016 19:28:51 +0000 (15:28 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 27 Sep 2016 19:28:51 +0000 (15:28 -0400)
When the given page is a child of Members Only, even if the
glm-members-only-template.php is not the selected template, then
apply the Member DB front styles.

setup/frontHooks.php

index 5c1d32b..779eba9 100644 (file)
@@ -244,9 +244,11 @@ function glm_members_only_template( $template ) {
     $templateName = "glm-members-only-template.php";
     $membersOnlyPage = get_option(GLM_MEMBERS_PLUGIN_OPTION_MEMBERS_ONLY_ID);
     $newTemplate = locate_template( $templateName );
-    if ( (is_in_tree($membersOnlyPage)) && ($newTemplate != "") ) { // if in same tree as the members page for this site
+    if ( is_in_tree( $membersOnlyPage ) ) { // if in same tree as the members page for this site
         do_action('glmMembersFrontCSSFilter');
-        return $newTemplate;
+        if ( $newTemplate != "" ) {
+            return $newTemplate;
+        }
         /* //Uncomment this if you want every child page of the members only page to be given the members only template
          * // (i.e. changed in the database) and not just using them on the front-end