Saltar al contenido
No hay resultados
  • Inicio
  • Blog
  • Contacto
  • Herramientas
  • Plugins
    • AR Model Viewer for WooCommerce
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Metaly for ACF and SCF
    • Raffly – Raffles to WooCommerce
    • Reelify
    • Ticket Sales and Scan QR
    • Wizard Cart Import
LinkedIn GitHub WordPress WhatsApp TikTok
LinkedIn GitHub WordPress WhatsApp TikTok
racmanuel.dev
  • Inicio
  • Blog
  • Contacto
  • Herramientas
  • Plugins
    • AR Model Viewer for WooCommerce
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Metaly for ACF and SCF
    • Raffly – Raffles to WooCommerce
    • Reelify
    • Ticket Sales and Scan QR
    • Wizard Cart Import
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
Ver categorías
  • Home
  • Docs
  • Custom Fields Booster
  • HTML

HTML

1 min read

0:00 / 2:42
  • Ver como Markdown Abrir esta página como Markdown sin formato (se abre en una nueva pestaña)
  • Abrir en ChatGPT Hacer preguntas sobre esta página (se abre en una nueva pestaña)
  • Abrir en Claude Hacer preguntas sobre esta página (se abre en una nueva pestaña)
  • Abrir en Google AI Studio Hacer preguntas sobre esta página (se requiere cuenta de Google) (se abre en una nueva pestaña)

Provides an HTML editor powered by WordPress CodeMirror.

The field stores sanitized HTML as a string.

Use Cases #

  • Add custom HTML blocks to a post
  • Store formatted snippets for templates
  • Capture reusable markup fragments
  • Maintain short HTML instructions
  • Embed sanitized HTML in layouts

Field Preview #

A textarea enhanced with CodeMirror in HTML mode.

How to Use #

  1. Add the HTML Field to a Field Group.
  2. Set a Placeholder if needed.
  3. Set Rows to control the visible editor height.
  4. Save the Field Group and edit a post.

Field Settings #

SettingDescriptionDefault
PlaceholderText shown when field is empty

Enter your HTML…

RowsVisible height of the editor8

Value & Storage #

Saved as: Post meta

Storage type: String

Return format: string

REST format: not specified

Important details:

  • Value is sanitized with wp_kses_post() on save.

Output Examples #

PHP #

$html = get_field('my_html');

if (is_string($html) && $html !== '') {
    echo wp_kses_post($html);
}

Twig #

{% set html = fn('get_field', 'my_html') %}
{% if html %}
  {{ html|e('html') }}
{% endif %}

Compatibility #

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

Hooks (Developer) #

Hooks Summary #

HookTypePurpose
custom_fields_booster_html_defaultsFilterModify default settings.
custom_fields_booster_html_supportsFilterModify ACF support flags.
custom_fields_booster_html_before_renderActionRun logic before rendering UI.
custom_fields_booster_html_after_renderActionRun logic after rendering UI.
custom_fields_booster_html_editor_idFilterModify editor DOM ID.
custom_fields_booster_html_textarea_attsFilterModify textarea attributes.
custom_fields_booster_html_before_settingsActionRun logic before rendering settings UI.
custom_fields_booster_html_setting_placeholderFilterModify placeholder setting config.
custom_fields_booster_html_setting_rowsFilterModify rows setting config.
custom_fields_booster_html_after_settingsActionRun logic after rendering settings UI.
custom_fields_booster_html_before_enqueueActionRun logic before enqueuing assets.
custom_fields_booster_html_codemirror_settingsFilterModify CodeMirror settings.
custom_fields_booster_html_after_enqueueActionRun logic after enqueuing assets.
custom_fields_booster_html_load_valueFilterModify value after loading.
custom_fields_booster_html_validate_valueFilterModify validation result.
custom_fields_booster_html_update_valueFilterModify value before saving.
custom_fields_booster_html_format_valueFilterModify value returned by get_field().

Filters #

Filter: custom_fields_booster_html_codemirror_settings

Purpose: Modify CodeMirror settings.

When: You want to adjust editor behavior.

add_filter('custom_fields_booster_html_codemirror_settings', function ($settings, $field_instance) {
    $settings['codemirror']['lineNumbers'] = false;
    return $settings;
}, 10, 2);

Actions #

Action: custom_fields_booster_html_before_render

Runs before rendering the field UI.

add_action('custom_fields_booster_html_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/cfb-field-html.js
  • admin/css/cfb-html-field.css
  • WordPress Code Editor assets (wp-theme-plugin-editor, wp-codemirror)

REST API #

Schema: not specified

REST Validation #

Validation uses validate_value() on REST writes.

Security & Escaping #

  • Value is sanitized with wp_kses_post() on save.
  • Output should be escaped in templates.

Notes / Limitations #

  • The editor runs CodeMirror in text/html mode.

Changelog #

  • 1.0.0 — Initial release
Actualizado el 24/02/2026
Free

Was the documentation helpful?

  • Feliz
  • Normal
  • Triste
AddressCode Scan
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
  • Inicio
  • Blog
  • Contacto
  • Herramientas
  • Plugins

Copyright © 2024. Hecha ❤️ con WordPress.

English