LLMS_L10n::get_js_strings( boolean $json = true )
Create an object of translatable strings
Description Description
This object is added to the LLMS.l10n JS object the text used in JS MUST exactly match the string found in this object which is redundant but is the best and lightest weight solution I could dream up quickly
Parameters Parameters
- $json
-
(boolean) (Optional) if true, convert to JSON, otherwise return the array
Default value: true
Return Return
(string|array)
Source Source
File: includes/class.llms.l10n.php
public static function get_js_strings( $json = true ) { $strings = array(); // add strings that should only be translated on the admin panel if ( is_admin() ) { $strings = apply_filters( 'lifterlms_js_l10n_admin', $strings ); } // allow filtering so extensions don't have to implement their own l10n functions $strings = apply_filters( 'lifterlms_js_l10n', $strings ); if ( true === $json ) { return json_encode( $strings ); } else { return $strings; } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
2.7.3 | Introduced. |