PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.3.7
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.3.7
7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / wpmu-lib / inc / class-thelib-session.php
wordpress-popup / lib / wpmu-lib / inc Last commit date
class-thelib-array.php 5 years ago class-thelib-core.php 5 years ago class-thelib-debug.php 5 years ago class-thelib-html.php 5 years ago class-thelib-net.php 5 years ago class-thelib-session.php 5 years ago class-thelib-ui.php 5 years ago class-thelib-updates.php 5 years ago class-thelib.php 5 years ago
class-thelib-session.php
57 lines
1 <?php
2 /**
3 * The Session storage component.
4 * Access via function `lib3()->session`.
5 *
6 * @since 1.1.4
7 */
8 class TheLib_Session extends TheLib {
9
10 /**
11 * Adds a value to the data collection in the user session.
12 *
13 * @since 1.0.15
14 * @api
15 *
16 * @param string $key The key of the value.
17 * @param mixed $value Value to store.
18 */
19 public function add( $key, $value ) {
20 self::_sess_add( 'store:' . $key, $value );
21 }
22
23 /**
24 * Returns the current data array of the specified value from user session.
25 *
26 * @since 1.0.15
27 * @api
28 *
29 * @param string $key The key of the value.
30 * @return array The value, or an empty array if no value was assigned yet.
31 */
32 public function get( $key ) {
33 $vals = self::_sess_get( 'store:' . $key );
34 foreach ( $vals as $key => $val ) {
35 if ( null === $val ) { unset( $vals[ $key ] ); }
36 }
37 $vals = array_values( $vals );
38 return $vals;
39 }
40
41 /**
42 * Returns the current data array of the specified value from user session
43 * and then clears the values from the session.
44 *
45 * @since 1.0.15
46 * @api
47 *
48 * @param string $key The key of the value.
49 * @return array The value, or an empty array if no value was assigned yet.
50 */
51 public function get_clear( $key ) {
52 $val = $this->get( $key );
53 self::_sess_clear( 'store:' . $key );
54 return $val;
55 }
56
57 }