PluginProbe
Slider Block by Sliderberg – WordPress Slider & Carousel Plugin for Gutenberg / trunk
Slider Block by Sliderberg – WordPress Slider & Carousel Plugin for Gutenberg vtrunk
1.2.3 1.2.2 1.2.0 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.7 1.0.8 1.0.9
sliderberg / includes / security.php

security.php in Slider Block by Sliderberg – WordPress Slider & Carousel Plugin for Gutenberg trunk, at includes/security.php

35 lines 783 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Security helpers for Sliderberg.
4 *
5 * @package Sliderberg
6 */
7
8 if ( ! defined( 'ABSPATH' ) ) {
9 exit;
10 }
11
12 /**
13 * Generate a nonce for the given action.
14 *
15 * Thin wrapper around wp_create_nonce() so callers don't depend directly on
16 * the WP function name and the implementation can be swapped later.
17 *
18 * @param string $action Action name.
19 * @return string Nonce value.
20 */
21 function sliderberg_generate_secure_nonce( $action ) {
22 return wp_create_nonce( $action );
23 }
24
25 /**
26 * Verify a nonce for the given action.
27 *
28 * @param string $nonce Nonce value to verify.
29 * @param string $action Action name.
30 * @return bool True if valid, false otherwise.
31 */
32 function sliderberg_verify_secure_nonce( $nonce, $action ) {
33 return (bool) wp_verify_nonce( $nonce, $action );
34 }
35