# polylang/trunk/src/Switcher/Assets.php

Polylang, version trunk. 63 lines.

- Page: https://pluginprobe.com/plugins/polylang/trunk/code/src/Switcher/Assets.php
- Raw: https://pluginprobe.com/plugins/polylang/trunk/raw/src/Switcher/Assets.php
- Modified: 2026-09-14T16:30:38+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/polylang/trunk/code/src/Switcher/Assets.php#L10-L20`.

```php
<?php
/**
 * @package Polylang
 */

namespace WP_Syntex\Polylang\Switcher;

defined( 'ABSPATH' ) || exit;

/**
 * Class that manages CSS and JS dependencies.
 *
 * @since 3.9
 */
class Assets {
	public const FRONTEND_ASSET_HANDLE = 'pll-language-switcher';

	/**
	 * Enqueues frontend CSS.
	 *
	 * @since 3.9
	 *
	 * @return void
	 */
	public static function enqueue_frontend_styles(): void {
		pll_enqueue_style( 'language-switcher' );
	}

	/**
	 * Enqueues frontend JS.
	 * Should be called on-the-fly when needed.
	 *
	 * @since 3.9
	 *
	 * @return void
	 */
	public static function enqueue_frontend_scripts(): void {
		pll_enqueue_script( 'language-switcher', array(), array( 'in_footer' => true ) );
	}

	/**
	 * Registers frontend CSS.
	 *
	 * @since 3.9
	 *
	 * @return void
	 */
	public static function register_styles(): void {
		pll_register_style( 'language-switcher' );
	}

	/**
	 * Registers frontend JS.
	 *
	 * @since 3.9
	 *
	 * @return void
	 */
	public static function register_scripts(): void {
		pll_register_script( 'language-switcher', array(), array( 'in_footer' => true ) );
	}
}

```
