LLMS_Admin_Assets::admin_print_scripts()

Initialize the “llms” object for other scripts to hook into


Description Description


Return Return

(void)


Top ↑

Source Source

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

	public function admin_print_scripts() {

		global $post;
		if ( ! empty( $post ) ) {

			$postdata = array(
				'id'        => $post->ID,
				'post_type' => $post->post_type,
			);

		} else {

			$postdata = array();

		}

		echo '
			<script type="text/javascript">
				window.llms = window.llms || {};
				window.llms.ajax_nonce = "' . wp_create_nonce( LLMS_AJAX::NONCE ) . '";
				window.llms.admin_url = "' . admin_url() . '";
				window.llms.post = ' . json_encode( $postdata ) . ';
			</script>
		';

		echo '<script type="text/javascript">window.LLMS = window.LLMS || {};</script>';
		echo '<script type="text/javascript">window.LLMS.l10n = window.LLMS.l10n || {}; window.LLMS.l10n.strings = ' . LLMS_L10n::get_js_strings( true ) . ';</script>';

	}

Top ↑

Changelog Changelog

Changelog
Version Description
4.4.0 Add ajax_nonce.
3.7.5 Unknown.
1.0.0 Introduced.


Top ↑

User Contributed Notes User Contributed Notes

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