Access WP session variable in CI
-
I am having trouble accessing the session variable I set in WordPress in Codeigniter. I am creating this functionality in my own plugin. Here is the code i am using:
function get_property_filters($atts) { global $wp_session; //if (!session_id()) session_start(); foreach ($atts as $key => $value) { if ($key == 'prop_type') { $wp_session['property_type'] = $value; } else { //apply_filters( 'attach_session_information', 'land'); $wp_session['property_type'] = 'land'; } } return '<pre>'.print_r($wp_session).'</pre>'; } add_shortcode('property_filters', 'get_property_filters');
- The topic ‘Access WP session variable in CI’ is closed to new replies.