PHP code example of x-wp / admin-notice-manager

1. Go to this page and download the library: Download x-wp/admin-notice-manager 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/ */

    

x-wp / admin-notice-manager example snippets




xwp_create_notice(
  array(
    'id' => 'my-plugin-notice',
    'type' => 'info',
    'message' => 'This is an informational notice.',
    'persistent' => true,
    'dismissible' => true,
  )
);



xwp_get_notice('my-plugin-notice')
  ->set_props(
    array(
    'id' => 'my-plugin-notice',
    'type' => 'info',
    'message' => 'This is an informational notice.',
    'persistent' => true,
    'dismissible' => true,
    )
  )
  ->save();