From: Chuck Scott Date: Tue, 30 Aug 2016 16:27:56 +0000 (-0400) Subject: Added test fix for intermittant event detail pages. X-Git-Tag: v1.3.2^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fhotfix%2F1.3.2;p=WP-Plugins%2Fglm-member-db-events.git Added test fix for intermittant event detail pages. --- diff --git a/index.php b/index.php index d40a3b1..daa3705 100644 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Members Database Events * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media Members Database. - * Version: 1.3.1 + * Version: 1.3.2 * Author: Chuck Scott * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -20,7 +20,7 @@ * @package glmMembersDatabaseEventsAddOn * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 1.3.1 + * @version 1.3.2 */ /* @@ -38,7 +38,7 @@ * so that we're sure the other add-ons see an up to date * version from this plugin. */ -define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.3.1'); +define('GLM_MEMBERS_EVENTS_PLUGIN_VERSION', '1.3.2'); define('GLM_MEMBERS_EVENTS_PLUGIN_DB_VERSION', '0.0.20'); // This is the minimum version of the GLM Members DB plugin require for this plugin. diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 205dd5a..c40c2f7 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -26,6 +26,24 @@ * *** Also note that parameters will be in the context of the main front controller constructor. *** */ +// Setup rewrite for member detail pages +add_filter('rewrite_rules_array', function($rules) { + + // Check if rule is not set + if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$'] ) ) { + + // Add the new rule + $newrules = array(); + $newrules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$']='index.php?pagename=$matches[1]&eventslug=$matches[2]'; + return $newrules + $rules; + } + + // If already set, just return the rules unchanged. + return $rules; + +}); + +/* This code is being replace for testing by the above to avoid intermittent 404's on the detail pages. // Check if the canonical event page rewrite rule is not currently in place. $rules = get_option( 'rewrite_rules' ); if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([^/]*)$'] ) ) { @@ -44,6 +62,7 @@ if ( ! isset( $rules['('.$this->config['settings']['canonical_event_page'].')/([ }); } +*/ /* * Event Detail Page Canonical URL Fix