js_escape

FILTER wp-includes\formatting.php (ligne 4678) github
Filters a string cleaned and escaped for output in JavaScript. Text passed to esc_js() is stripped of invalid or special characters, and properly slashed for output.

Paramètres

Entrée :
$safe_text, $text
Sortie :
@param string $safe_text The text after it has been escaped.
@param string $text      The text prior to being escaped.

Utilisation

// Modifier la valeur avec le filtre 'js_escape'
add_filter('js_escape', 'ma_fonction_filtre', 10, 1);

function ma_fonction_filtre($safe_text) {
    // Modifier la valeur
    return $safe_text;
}

Actualités

Chargement des actualités...