Plugin Directory

Changeset 1824010


Ignore:
Timestamp:
02/18/2018 02:13:46 AM (8 years ago)
Author:
pmac8
Message:

fixed persistent notices bug

File:
1 edited

Legend:

Unmodified
Added
Removed
  • demo-content-templates/trunk/src/Infrastructure/WP_Persistent_Notices.php

    r1801770 r1824010  
    4040      'location'     => 'default'
    4141    );
    42     add_action('admin_init', array($this, 'admin_init'));
    4342    add_action('admin_notices', array($this, 'render_notices'));
    4443    add_action('wp_ajax_get_persistent_notices', array(
     
    4746    ));
    4847    add_action('shutdown', array($this, 'save_notices'));
    49   }
    50 
    51   public function admin_init() {
    52     // add a filter and that returns true to replace or prevent the session initialization functionality
    53     if (!apply_filters('wp_persistent_notices_replace_initialization', FALSE)) {
    54         if (session_status() == PHP_SESSION_NONE) {
    55             try {
    56                 session_start();
    57             }catch (\Exception $e) {
    58                
    59             }
    60       }
    61     }
    6248  }
    6349
Note: See TracChangeset for help on using the changeset viewer.