src/WPametu/Http/PostRedirectGet.php
private function writeSession($message, $from = '', $is_error = false){
        if( session_id() ){
            $key = $is_error ? $this->error_key : $this->message_key;
            // Initialize
            if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
                $_SESSION[$key] = [];
            }
            // Add message
            $_SESSION[$key][] = ( empty($from) ? '' : sprintf('<strong>[%s]</strong> ', $from) ).$message;
        }
    }
private function writeSession($message, $from = '', $is_error = false){
        if( session_id() ){
            $key = $is_error ? $this->error_key : $this->message_key;
            // Initialize
            if( !isset($_SESSION[$key]) || !is_array($_SESSION[$key]) ){
                $_SESSION[$key] = [];
            }
            // Add message
            $_SESSION[$key][] = ( empty($from) ? '' : sprintf('<strong>[%s]</strong> ', $from) ).$message;
        }
    }
private function writeSession ( $ message , $ from = '' , $ is_error = false ) { if ( session_id ( ) ) { $ key = $ is_error ? $ this -> error_key : $ this -> message_key ; // Initialize if ( ! isset ( $ _SESSION [ $ key ] ) || ! is_array ( $ _SESSION [ $ key ] ) ) { $ _SESSION [ $ key ] = [ ] ; } // Add message $ _SESSION [ $ key ] [ ] = ( empty ( $ from ) ? '' : sprintf ( '<strong>[%s]</strong> ' , $ from ) ) . $ message ; } }
Write message to session

@param $message
@param string $from
@param bool $is_error
Write message to session