Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

render_csrf_data_attributes()

Description

Render CSRF information as data attributes. Useful to allow JS to run state changing operations

Parameters

ColumnTypeDefaultDescription
$ident

Location

include/render_functions.php lines 3741 to 3747

Definition

 
function render_csrf_data_attributes($ident)
    {
    global 
$CSRF_token_identifier$usersession;

    
$token generateCSRFToken($usersession$ident);
    return 
"data-csrf-token-identifier=\"{$CSRF_token_identifier}\" data-csrf-token=\"{$token}\"";
    }

This article was last updated 19th March 2024 04:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.