Skip to content
No results
  • Home
  • Tutorials
  • Plugins
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Raffly – Raffles to WooCommerce
    • Wizard Cart Import
    • AR Model Viewer for WooCommerce
  • Projects
  • Tools
  • Contact
LinkedIn GitHub WordPress WhatsApp TikTok
LinkedIn GitHub WordPress WhatsApp TikTok
racmanuel.dev
  • Home
  • Tutorials
  • Plugins
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Raffly – Raffles to WooCommerce
    • Wizard Cart Import
    • AR Model Viewer for WooCommerce
  • Projects
  • Tools
  • Contact
Contacto

racmanuel.dev

AR Model Viewer for WooCommerce

4
  • Getting Started
  • Description
  • Requisites
  • Installation Guide

Custom Fields Booster

5
  • HTML
  • Code Scan
  • Checklist
  • Action Button
  • Address

Flow POS - Point of Sale for WooCommerce

1
  • Hooks and Filters
View Categories
  • Home
  • Docs
  • Custom Fields Booster
  • Code Scan

Code Scan

3 min read

Scans QR codes or barcodes using the device camera and stores the scanned value.

The field also supports manual input in a single-line text field.

Use Cases #

  • Capture product barcodes in the editor
  • Scan QR codes for asset tracking
  • Store serial numbers from labels
  • Quick entry of inventory IDs
  • Validate labels during content entry

Field Preview #

A text input with Scan and Clear buttons, plus a modal scanner UI.

How to Use #

  1. Add the Code Scan field to a Field Group.
  2. Set a placeholder if needed.
  3. Configure FPS and QR Box size.
  4. Enable Auto close after scan if desired.
  5. Enable Remember last camera if desired.
  6. Choose Trim value and Uppercase behavior.
  7. Save the Field Group and use Scan in the editor.

Field Settings #

SettingDescriptionDefault
PlaceholderText shown when field is emptyScan result will appear here…
FPSFrames per second for scanning10
QR BoxSize (px) of the scanning box250
Auto close after scanClose the scanner modal after a successful scan1
Remember last cameraStore last used camera in localStorage1
Trim valueTrim whitespace from scanned value1
UppercaseConvert scanned value to uppercase0

Value & Storage #

Saved as: Post meta

Storage type: String

Return format: string

REST format: not specified

Important details:

  • Optional trimming and uppercasing are applied before saving.
  • Value is sanitized with sanitize_text_field().

Output Examples #

PHP #

$value = get_field('my_code_scan');

if (is_string($value) && $value !== '') {
    echo esc_html($value);
}

Twig #

{% set value = fn('get_field', 'my_code_scan') %}
{% if value %}
  {{ value|e }}
{% endif %}

Compatibility #

  • Repeaters
  • Flexible Content
  • Options Pages
  • Frontend forms (acf_form)
  • REST API
  • Multisite

Hooks (Developer) #

Hooks Summary #

HookTypePurpose
custom_fields_booster_code_scan_defaultsFilterModify default settings.
custom_fields_booster_code_scan_supportsFilterModify ACF support flags.
custom_fields_booster_code_scan_before_renderActionRun logic before rendering UI.
custom_fields_booster_code_scan_after_renderActionRun logic after rendering UI.
custom_fields_booster_code_scan_instance_idFilterModify instance id.
custom_fields_booster_code_scan_input_attsFilterModify input attributes.
custom_fields_booster_code_scan_before_settingsActionRun logic before rendering settings UI.
custom_fields_booster_code_scan_after_settingsActionRun logic after rendering settings UI.
custom_fields_booster_code_scan_before_enqueueActionRun logic before enqueuing assets.
custom_fields_booster_code_scan_after_enqueueActionRun logic after enqueuing assets.
custom_fields_booster_code_scan_load_valueFilterModify value after loading.
custom_fields_booster_code_scan_validate_valueFilterModify validation result.
custom_fields_booster_code_scan_update_valueFilterModify value before saving.
custom_fields_booster_code_scan_format_valueFilterModify value returned by get_field().

Filters #

Filter: custom_fields_booster_code_scan_input_atts

Purpose: Modify input HTML attributes.

When: You need to add data attributes for custom JS.

add_filter('custom_fields_booster_code_scan_input_atts', function ($atts, $field, $field_instance) {
    $atts['data-custom'] = '1';
    return $atts;
}, 10, 3);

Actions #

Action: custom_fields_booster_code_scan_before_render

Runs before rendering the field UI.

add_action('custom_fields_booster_code_scan_before_render', function ($field, $field_instance) {
    // Pre-render logic.
}, 10, 2);

Assets #

This field enqueues assets whenever the input is rendered (admin and frontend via acf_form()):

  • admin/js/libs/html5-qrcode.min.js
  • admin/js/cfb-field-code-scan.js
  • admin/css/cfb-field-code-scan.css

REST API #

Schema: not specified

REST Validation #

Validation uses validate_value() on REST writes.

Security & Escaping #

  • Saved value is sanitized with sanitize_text_field().
  • Optional trimming and uppercasing are applied before saving.
  • Field HTML output escapes all attributes and UI labels.

Notes / Limitations #

  • Scanner UI depends on camera access and the bundled html5-qrcode library.

Changelog #

  • 1.0.0 — Initial release
Updated on 24/02/2026
Free

Was the documentation helpful?

  • Happy
  • Normal
  • Sad
HTMLChecklist
Table of Content
  • Use Cases
  • Field Preview
  • How to Use
  • Field Settings
  • Value & Storage
  • Output Examples
    • PHP
    • Twig
  • Compatibility
  • Hooks (Developer)
    • Hooks Summary
    • Filters
    • Actions
  • Assets
  • REST API
  • REST Validation
  • Security & Escaping
  • Notes / Limitations
  • Changelog

racmanuel.dev

Ayudamos a crecer tu empresa mediante soluciones tecnológicas personalizadas. Nos especializamos en desarrollar herramientas que optimizan procesos, aumentan la eficiencia y generan resultados visibles.

Información de Contacto

  • Teléfono: +52 (444) 380 57 40
  • WhatsApp: +52 (444) 380 57 40
  • Correo: developer@racmanuel.dev
  • Dirección: 78250 San Luis Potosí, S.L.P., San Luis Potosí, México
  • Home
  • Tutorials
  • Plugins
  • Projects
  • Tools
  • Contact

Copyright © 2024. Hecha ❤️ con WordPress.