Exemplo n.º 1
0
/**
 * Check if there is a notice to dismiss.
 *
 * @since  3.1.5
 *
 * @param array $data Contains the notice ID
 *
 * @return void
 */
function wpas_grab_notice_dismiss($data)
{
    $notice_id = isset($data['notice_id']) ? $data['notice_id'] : false;
    if (false === $notice_id) {
        return;
    }
    wpas_dismiss_notice($notice_id);
}
/**
 * Check if there is a notice to dismiss.
 *
 * @since  3.1.5
 * @return void
 */
function wpas_grab_notice_dismiss()
{
    $dismiss = filter_input(INPUT_GET, 'wpas-dismiss', FILTER_SANITIZE_STRING);
    $nonce = filter_input(INPUT_GET, 'wpas-nonce', FILTER_SANITIZE_STRING);
    if (!empty($dismiss) && !empty($nonce)) {
        if (wpas_check_nonce($nonce)) {
            wpas_dismiss_notice($dismiss);
        }
    }
}