PHP code example of pxlrbt / wordpress-notifier

1. Go to this page and download the library: Download pxlrbt/wordpress-notifier library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

pxlrbt / wordpress-notifier example snippets




Notifier::getInstance();
#or
$notifier = new Notifier()

// Static functions refer to last Notifier created
Notifier::info('An update is available.');
Notifier::error('Oops, something went wrong!');

// Advanced usage
$notifier->dispatch(
    Notification::create('Plugin configuration is missing!')
        ->id('plugin_xy.config.failed')
        ->type('error')
        ->title('ERROR')
        ->dismissible(true)
        ->persistent(true);
)


$id = 'plugin_xy.config.failed';
$notifier->containsNotification($id);

$id = 'plugin_xy.config.failed';
$notifier->removeNotification($id);