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 3685 to 3691

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 18th May 2024 21:35 Europe/London time based on the source file dated 17th May 2024 16:45 Europe/London time.