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.
nullin stead of
- 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
FlashMessage class object like below-
$flash_message = new \CodeMascot\WPFlashMessage\FlashMessage();
Turn on the
SESSION in PHP like below-
Set you message like below-
$flash_message->error( __( 'Your message here', 'text-domain' ), // This is the URL where you want to redirect. home_url() );
SESSION message like below-
// Display the messages $flash_message->display();
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.