PluginProbe ʕ •ᴥ•ʔ
Kirki – Freeform Page Builder, Website Builder & Customizer / 6.0.13
Kirki – Freeform Page Builder, Website Builder & Customizer v6.0.13
6.1.1 6.1.0 6.0.14 6.0.13 6.0.12 6.0.11 6.0.10 6.0.9 6.0.8 6.0.7 6.0.6 6.0.5 6.0.4 6.0.3 6.0.2 6.0.1 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.1.8 3.1.9 4.0.19 4.0.20 4.0.21 4.0.22 4.0.23 4.0.24 4.1 4.2.0 5.0.0 5.1.0 5.1.1 5.2.0 5.2.1 5.2.2 5.2.3 6.0.0 trunk 3.0.40 3.0.41 3.0.42 3.0.43 3.0.44 3.0.45 3.1.0 3.1.1 3.1.2
kirki / customizer / packages / compatibility / src / Scripts.php
kirki / customizer / packages / compatibility / src Last commit date
deprecated 1 month ago Aliases.php 2 months ago Config.php 5 months ago Control.php 5 months ago Deprecated.php 5 months ago Field.php 2 months ago Framework.php 5 months ago Init.php 2 months ago Kirki.php 2 months ago Modules.php 2 months ago Pro_Namespace_Compatibility.php 5 months ago Sanitize_Values.php 5 months ago Scripts.php 2 months ago Settings.php 5 months ago Values.php 5 months ago
Scripts.php
61 lines
1 <?php
2 /**
3 * Registers scripts for WordPress Compatibility with versions prior to WP5.0
4 *
5 * @package Kirki
6 * @category Core
7 * @author Themeum
8 * @copyright Copyright (c) 2023, Themeum
9 * @license https://opensource.org/licenses/MIT
10 * @since 0.1
11 */
12
13 namespace Kirki\Compatibility;
14
15 if ( ! defined( 'ABSPATH' ) ) {
16 exit;
17 }
18
19 use Kirki\URL;
20
21 /**
22 * Adds scripts for backwards-compatibility
23 *
24 * @since 0.1
25 */
26 class Scripts {
27
28 /**
29 * Constructor.
30 *
31 * @access public
32 * @since 0.1
33 */
34 public function __construct() {
35 global $wp_version;
36
37 /**
38 * Check if the WordPress version is lower than 5.0
39 * If lower then we need to enqueue the backported scripts.
40 */
41 if ( version_compare( $GLOBALS['wp_version'], '5.0', '<' ) ) {
42 add_action( 'admin_register_scripts', [ $this, 'register_scripts' ] );
43 add_action( 'customize_controls_enqueue_scripts', [ $this, 'register_scripts' ] );
44 }
45 }
46
47 /**
48 * Enqueue missing WP scripts.
49 *
50 * @access public
51 * @since 0.1
52 * @return void
53 */
54 public function register_scripts() {
55 $folder_url = trailingslashit( URL::get_from_path( __DIR__ ) );
56 wp_register_script( 'wp-polyfill', $folder_url . 'scripts/wp-polyfill.js', [], '7.0.0', false );
57 wp_register_script( 'wp-hooks', $folder_url . 'scripts/hooks.js', [ 'wp-polyfill' ], '2.2.0', false );
58 wp_register_script( 'wp-i18n', $folder_url . 'scripts/i18n.js', [ 'wp-polyfill' ], '3.3.0', false );
59 }
60
61 }