Commit 247131ad authored by kcristiano's avatar kcristiano Committed by GitHub

Merge pull request #143 from christianwach/issue-wp-16

Fix fatal error with some versions of PHP
parents e812fef4 8af9b947
......@@ -335,11 +335,14 @@ class CiviCRM_For_WordPress {
wp_die( __( 'Only one instance of CiviCRM_For_WordPress please', 'civicrm' ) );
}
// Get existing session ID
$session_id = session_id();
/*
* There is no session handling in WP - hence we start it for CiviCRM pages
* except when running via WP-CLI which does not require sessions.
*/
if ( empty( session_id() ) && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
if ( empty( $session_id ) && ! ( defined( 'WP_CLI' ) && WP_CLI ) ) {
session_start();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment