A PHP Composer library for WordPress to make front-end flash messaging easy.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


WP Flash Message

A PHP Composer library for WordPress to make front-end flash messaging easy.

Table Of Contents

Coding styles and technique

  • All input data escaped and validated.
  • PSR-4 autoloading used.
  • Developed as Composer package.
  • YODA condition check applied.
  • Maintained Right Margin carefully. Usually that is 80 characters.
  • Used true, false and null in stead of TRUE, FALSE and NULL.
  • INDENTATION: TABS has been used in stead of SPACES.
  • PHP Codesniffer checked.
  • WordPress VIP coding standard followed mostly.


The best way to use this package is through Composer:

$ composer require codemascot/wp-flash-message


Step 1

Instantiate the FlashMessage class object like below-

$flash_message = new \CodeMascot\WPFlashMessage\FlashMessage();

Step 2

Turn on the SESSION in PHP like below-


Step 3

Set you message like below-

		'Your message here',
	// This is the URL where you want to redirect.

Step 4

Display the SESSION message like below-

// Display the messages

Step 5

Write CSS style as you want to style the message.

Crafted by Khan

I'm Khan AKA CodeMascot a professional web developer and I've written this script for my personal usage.


Copyright (c) 2018 Khan M Rashedun-Naby, CodeMascot

Good news, this plugin is free for everyone! Since it's released under the MIT License you can use it free of charge on your personal or commercial website.


All feedback / bug reports / pull requests are welcome.