# sliderberg/trunk/includes/security.php

Slider Block by Sliderberg – WordPress Slider &amp; Carousel Plugin for Gutenberg, version trunk. 35 lines.

- Page: https://pluginprobe.com/plugins/sliderberg/trunk/code/includes/security.php
- Raw: https://pluginprobe.com/plugins/sliderberg/trunk/raw/includes/security.php
- Modified: 2026-06-24T04:30:08+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/sliderberg/trunk/code/includes/security.php#L10-L20`.

```php
<?php
/**
 * Security helpers for Sliderberg.
 *
 * @package Sliderberg
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Generate a nonce for the given action.
 *
 * Thin wrapper around wp_create_nonce() so callers don't depend directly on
 * the WP function name and the implementation can be swapped later.
 *
 * @param string $action Action name.
 * @return string Nonce value.
 */
function sliderberg_generate_secure_nonce( $action ) {
	return wp_create_nonce( $action );
}

/**
 * Verify a nonce for the given action.
 *
 * @param string $nonce  Nonce value to verify.
 * @param string $action Action name.
 * @return bool True if valid, false otherwise.
 */
function sliderberg_verify_secure_nonce( $nonce, $action ) {
	return (bool) wp_verify_nonce( $nonce, $action );
}

```
