Commented out flush_rules() as it was clearing rewrite rules - need to investigate feature/lauryShortcodeBuilder
authorChuck Scott <cscott@gaslightmedia.com>
Thu, 16 Jun 2016 18:25:57 +0000 (14:25 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Thu, 16 Jun 2016 19:43:01 +0000 (15:43 -0400)
setup/frontHooks.php

index c037f9e..4a1bf75 100644 (file)
@@ -44,7 +44,7 @@ add_filter('init', function() {
     $rules = get_option( 'rewrite_rules' );
     if ( ! isset( $rules['('.$this->config['settings']['canonical_member_page'].')/([^/]*)$'] ) ) {
         global $wp_rewrite;
-        $wp_rewrite->flush_rules();
+// Seems to cause loss of rewrite rules -Need to investigate        $wp_rewrite->flush_rules();
     }
 });
 
@@ -114,7 +114,7 @@ if (!function_exists('get_id_by_slug')) {
 }
 
 /*
- * This function makes it easier to grab page content of any page by using the 
+ * This function makes it easier to grab page content of any page by using the
  * page ID, which WP does not natively do.
  */
 if (!function_exists('get_post_page_content')) {
@@ -143,10 +143,10 @@ function glm_members_only_template( $template ) {
         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
-         
+
          * global $post;
          * update_post_meta($post->ID, '_wp_page_template', $templateName);
-         * 
+         *
          */
     //} else if (is_in_tree($membersOnlyPage)) {
         // Bad template;
@@ -157,7 +157,7 @@ function glm_members_only_template( $template ) {
 }
 
 /*
- * 
+ *
  */
 add_filter('glm_associate_config', function() {
     return $this->config;