From: Chuck Scott Date: Mon, 26 Nov 2018 16:59:27 +0000 (-0500) Subject: Moved session init to index from adminHooks to fix pseudo-random sort on front-end. X-Git-Tag: v2.11.0^2~53 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e2fb66a68fb8f1d5ea9d1e435d053b8ca2add233;p=WP-Plugins%2Fglm-member-db.git Moved session init to index from adminHooks to fix pseudo-random sort on front-end. --- diff --git a/index.php b/index.php index 454e7a9f..64253a9c 100755 --- a/index.php +++ b/index.php @@ -3,7 +3,7 @@ * Plugin Name: GLM Associate - Members Plugin * Plugin URI: http://www.gaslightmedia.com/ * Description: Gaslight Media GLM Associate core plugin and Members database. - * Version: 2.10.45 + * Version: 2.10.46 * Author: Gaslight Media * Author URI: http://www.gaslightmedia.com/ * License: GPL2 @@ -19,7 +19,7 @@ * @package glmMembersDatabase * @author Chuck Scott * @license http://www.gaslightmedia.com Gaslightmedia - * @version 2.10.45 + * @version 2.10.46 */ $GLOBALS['glmAssociateMemTracker'] = memory_get_usage(); @@ -47,7 +47,7 @@ if (!defined('ABSPATH')) { * */ -define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.45'); +define('GLM_MEMBERS_PLUGIN_VERSION', '2.10.46'); define('GLM_MEMBERS_PLUGIN_DB_VERSION', '1.1.44'); // Check if plugin version is not current in WordPress option and if needed updated it @@ -429,6 +429,13 @@ if (GLM_MEMBERS_PLUGIN_DEBUG_VERBOSE) { trigger_error(glmAssociateMemoryUsage()." - End glm-member-db setup",E_USER_NOTICE); } +// Initialize a PHP session if not already set +add_action( 'init', function(){ + if ( ! session_id() ) { + session_start(); + } +}); + /* * * Run desired controller diff --git a/readme.txt b/readme.txt index b38dd1e3..1f10cb7f 100755 --- a/readme.txt +++ b/readme.txt @@ -70,6 +70,9 @@ There is of course much more to this. * Fixed member listings not using selected sort order setting past first page. * Smarty Templates updated to version 3.1.33 due to use of "each()" that is being depricated in PHP. += 2.10.46 = +* Moved session startup from adminHooks.php to index.php to ensure there's always a session started. + = 2.10.43 = * Country is no longer required for Authorize.net Payment Gateway unless International payment diff --git a/setup/adminHooks.php b/setup/adminHooks.php old mode 100644 new mode 100755 index 2f167d2d..825f15df --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -398,10 +398,3 @@ function glm_admin_import_help_tab () { __( 'Help Guide' ) . '

' ); } - -// If no session then start one. -add_action( 'init', function(){ - if ( ! session_id() ) { - session_start(); - } -});