'; acf_text_input( [ 'class' => 'acf-avada_icon', 'value' => 'avada_icon' === $field['value']['type'] ? $field['value']['value'] : '', ] ); // Helper Text. ?>
'; } /** * Adds the inline script for the Avada icon tab data handling. * * @access public * @since 7.11.10 * @return void */ public function add_avada_icon_script_styles() { wp_add_inline_script( 'acf-input', ' acf.addAction( "ready", function() { const iconPickers = acf.getFields( acf.findFields( { type: "icon_picker" } ) ); jQuery.each( iconPickers, function( index, value ) { const self = value; value.$el.find( ".acf-avada_icon" ).on( "input", function( event ) { const currentValue = event.target.value; self.updateTypeAndValue( "avada_icon", currentValue ); } ); } ); } ); ' ); wp_add_inline_style( 'acf-input', ' .acf-icon-picker-avada-icon-tabs { display: flex; background-color: #f9f9f9; padding: 12px; border: 1px solid #8c8f94; } .acf-icon-picker-avada-icons { width: 100%; } ' ); } /** * Creates or returns an instance of this class. * * @static * @access public * @since 7.11.10 * @return object AWB_ACF */ public static function get_instance() { // If an instance hasn't been created and set to $instance create an instance and set it to $instance. if ( null === self::$instance ) { self::$instance = new AWB_ACF(); } return self::$instance; } } /** * Instantiates the AWB_ACF class. * Make sure the class is properly set-up. * * @since object 7.7 * @return object AWB_ACF */ function AWB_ACF() { // phpcs:ignore WordPress.NamingConventions return AWB_ACF::get_instance(); }