wp_session_encode

Encode the current session's data as a JSON string.

Description

(string) wp_session_encode(); 

Returns (string)


Usage

  1. if ( !function_exists( 'wp_session_encode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'ninja-forms/deprecated/includes/libraries/wp-session.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = wp_session_encode(); 
  7.  

Defined (2)

The function is defined in the following location(s).

/deprecated/includes/libraries/wp-session.php  
  1. function wp_session_encode() { 
  2. $wp_session = WP_Session::get_instance(); 
  3.  
  4. return $wp_session->json_out(); 
/includes/Libraries/Session/wp-session.php  
  1. function wp_session_encode() { 
  2. $wp_session = WP_Session::get_instance(); 
  3.  
  4. return $wp_session->json_out();