* * @package Dismissible Notices Handler/Helper Functions * @author Julien Liabeuf * @version 1.0 * @license GPL-2.0+ * @link https://julienliabeuf.com * @copyright 2016 Julien Liabeuf */ // If this file is called directly, abort. if ( ! defined( 'WPINC' ) ) { die; } /** * Register a new notice * * @since 1.0 * * @param string $id Notice ID, used to identify it * @param string $type Type of notice to display * @param string $content Notice content * @param array $args Additional parameters * * @return bool */ function dnh_register_notice( $id, $type, $content, $args = array() ) { if ( ! function_exists( 'DNH' ) ) { return false; } return DNH()->register_notice( $id, $type, $content, $args ); } /** * Restore a previously dismissed notice * * @since 1.0 * * @param string $id ID of the notice to restore * * @return bool */ function dnh_restore_notice( $id ) { if ( ! function_exists( 'DNH' ) ) { return false; } return DNH()->restore_notice( $id ); } /** * Check if a notice has been dismissed * * @since 1.0 * * @param string $id ID of the notice to check * * @return bool */ function dnh_is_dismissed( $id ) { if ( ! function_exists( 'DNH' ) ) { return false; } return DNH()->is_dismissed( $id ); }