LLMS_Admin_Assets::get_analytics_options()

Retrieve an array of options used to localize the llms.analytics JS instance.


Return Return

(array)


Top ↑

Source Source

File: includes/admin/class.llms.admin.assets.php

	protected function get_analytics_options() {

		/**
		 * Create a number format string readable by google charts
		 *
		 * Replacing `9.9` with `9,9` and `0,0` with `0.0` to prevent loading errors encountered
		 * as a result of the chart pattern not allowing usage of a comma for the decimal separator.
		 *
		 * @see https://stackoverflow.com/a/18204679/400568
		 */
		$currency_format = str_replace( array( '9.9', '0,0', '9' ), array( '9,9', '0.0', '#' ), llms_price_raw( 9990.00 ) );

		/**
		 * Customize Javascript localization options passed to the `llms.analytics` JS instance.
		 *
		 * @since 4.5.1
		 *
		 * @param array $opts Associative array of option data.
		 */
		return apply_filters( 'llms_get_analytics_js_options', compact( 'currency_format' ) );

	}


Top ↑

Changelog Changelog

Changelog
Version Description
4.5.1 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.