get_value(); // Prepare input ID. $input_id = sprintf( '%s_%s', esc_attr( $this->settings->get_input_name_prefix() ), esc_attr( $this->name ) ); // Display description. $html = $this->get_description(); $html .= ''; // Insert checkbox. $html .= sprintf( '', $input_id, checked( '1', $enabled, false ), $this->get_describer() ? sprintf( 'aria-describedby="%s"', $this->get_describer() ) : '', implode( ' ', $this->get_attributes() ) ); // Insert toggle UI. $html .= sprintf( ''; // Insert after input markup. $html .= rgobj( $this, 'after_input' ); // If field failed validation, add error icon. $html .= $this->get_error_icon(); $html .= ''; return $html; } } Fields::register( 'toggle', '\Gravity_Forms\Gravity_Forms\Settings\Fields\Toggle' );