HEX
Server: Apache
System: Linux sxb1plzcpnl503971.prod.sxb1.secureserver.net 4.18.0-553.52.1.lve.el8.x86_64 #1 SMP Wed May 21 15:31:29 UTC 2025 x86_64
User: nciq25gegoxa (9650876)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/nciq25gegoxa/public_html/wp-content/plugins/thim-core/inc/customizer/modules/tooltips.php
<?php
namespace ThimPress\Customizer\Modules;

class Tooltips {

	private $tooltips_content = array();

	public function __construct() {
		add_action( 'customize_controls_enqueue_scripts', array( $this, 'tooltips_scripts' ), 100 );
		add_filter( 'thim_customize_field_add_control_args', array( $this, 'filter_control_args' ), 10, 2 );
	}

	public function tooltips_scripts() {
		wp_localize_script( 'thim-customizer-control', 'thimCustomizerTooltips', $this->tooltips_content );
	}

	public function filter_control_args( $args, $wp_customize ) {
		if ( ! empty( $args['tooltip'] ) ) {
			$this->tooltips_content[ $args['id'] ] = array(
				'id'      => sanitize_key( $args['id'] ),
				'content' => wp_kses_post( $args['tooltip'] ),
			);
		}

		return $args;
	}
}