LLMS_Meta_Box_Award_Engagement_Submit::metabox_scripts()

Metabox specific scripts.


Return Return

(void)


Top ↑

Source Source

File: includes/admin/post-types/meta-boxes/class.llms.meta.box.award.engagement.submit.php

	public static function metabox_scripts() {
		?>
<script>
	document.addEventListener(
		"DOMContentLoaded",
		() => {
			// Localization.
			const __  = window.wp.i18n.__,
				_i18n = {
				'Publish on:'  : __( 'Award on:', 'lifterlms' ),
				'Publish'      : __( 'Award', 'lifterlms' ),
				'Published'    : __( 'Awarded', 'lifterlms' ),
				'Published on:': __( 'Awarded on:', 'lifterlms' ),
			};

			window.wp.hooks.addFilter(
				'i18n.gettext',
				'llms.awardEngagement.submitbox',
				( translation, text ) => {
					return text in _i18n ? _i18n[text] : translation;
				}
			);
		}
	);
</script>
		<?php
	}

Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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