tooltips_content[ $id ] = array( 'id' => $id, 'content' => $field['tooltip'], ); } } } /** * Allows us to add a tooltip to any control. * * @access public * @since 4.2.0 * @param string $field_id The field-ID. * @param string $tooltip The tooltip content. */ public function add_tooltip( $field_id, $tooltip ) { $this->tooltips_content[ $field_id ] = array( 'id' => sanitize_key( $field_id ), 'content' => wp_kses_post( $tooltip ), ); } /** * Enqueue scripts. * * @access public * @since 3.0.0 */ public function customize_controls_print_footer_scripts() { $this->parse_fields(); wp_enqueue_script( 'kirki-tooltip', trailingslashit( Kirki::$url ) . 'modules/tooltips/tooltip.js', array( 'jquery' ), KIRKI_VERSION, false ); wp_localize_script( 'kirki-tooltip', 'kirkiTooltips', $this->tooltips_content ); wp_enqueue_style( 'kirki-tooltip', trailingslashit( Kirki::$url ) . 'modules/tooltips/tooltip.css', array(), KIRKI_VERSION ); } }