Technical Docs

Search Documentation

Function: tribe_prepare_for_json

Function to prepare content for use as a value in a json encoded string destined for storage on a html data attribute.

Located at src/functions/template-tags/general.php (Line: 268)

Description

Hence the double quote fun, especially in case they pass html encoded " along. Any of those getting through to the data att will break jquery’s parseJSON method. Themers can use this function to prepare data they may want to send to tribe_events_template_data() in the templates, and we use it in that function ourselves.

Parameters summary

() $string

Return value summary

(string)

Examples

string tribe_prepare_for_json ( $string )