PluginProbe
Polylang / trunk
Polylang vtrunk
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / Switcher / Assets.php

Assets.php in Polylang trunk, at src/Switcher/Assets.php

63 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 namespace WP_Syntex\Polylang\Switcher;
7
8 defined( 'ABSPATH' ) || exit;
9
10 /**
11 * Class that manages CSS and JS dependencies.
12 *
13 * @since 3.9
14 */
15 class Assets {
16 public const FRONTEND_ASSET_HANDLE = 'pll-language-switcher';
17
18 /**
19 * Enqueues frontend CSS.
20 *
21 * @since 3.9
22 *
23 * @return void
24 */
25 public static function enqueue_frontend_styles(): void {
26 pll_enqueue_style( 'language-switcher' );
27 }
28
29 /**
30 * Enqueues frontend JS.
31 * Should be called on-the-fly when needed.
32 *
33 * @since 3.9
34 *
35 * @return void
36 */
37 public static function enqueue_frontend_scripts(): void {
38 pll_enqueue_script( 'language-switcher', array(), array( 'in_footer' => true ) );
39 }
40
41 /**
42 * Registers frontend CSS.
43 *
44 * @since 3.9
45 *
46 * @return void
47 */
48 public static function register_styles(): void {
49 pll_register_style( 'language-switcher' );
50 }
51
52 /**
53 * Registers frontend JS.
54 *
55 * @since 3.9
56 *
57 * @return void
58 */
59 public static function register_scripts(): void {
60 pll_register_script( 'language-switcher', array(), array( 'in_footer' => true ) );
61 }
62 }
63