A PHP Composer library for WordPress to make front-end flash messaging easy.
- 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,falseandnullin stead ofTRUE,FALSEandNULL. - 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-messageInstantiate the FlashMessage class object like below-
$flash_message = new \CodeMascot\WPFlashMessage\FlashMessage();Turn on the SESSION in PHP like below-
$flash_message->start_session();Set you message like below-
$flash_message->error(
__(
'Your message here',
'text-domain'
),
// This is the URL where you want to redirect.
home_url()
);Display the SESSION message like below-
// Display the messages
$flash_message->display();Write CSS style as you want to style the message.
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.