tooltips_content[ $id ] = array( 'id' => $id, 'content' => wp_kses_post( $field['tooltip'] ), ); } } } /** * Allows us to add a tooltip to any control. * * @access public * @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 */ public function customize_controls_print_footer_scripts() { $this->parse_fields(); wp_enqueue_script( 'hoo-tooltip', trailingslashit( Hoo::$url ) . 'modules/tooltips/tooltip.js', array( 'jquery' ) ); wp_localize_script( 'hoo-tooltip', 'hooTooltips', $this->tooltips_content ); wp_enqueue_style( 'hoo-tooltip', trailingslashit( Hoo::$url ) . 'modules/tooltips/tooltip.css', null ); } }