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
  • Action Button

Action Button

4 min read

Renders a button that triggers a custom action handler.

The field does not store a value; it only provides a UI trigger with optional confirmation and lockout.

Use Cases #

  • Run a manual sync task from an edit screen
  • Trigger a background job for a specific entry
  • Launch a custom maintenance action
  • Execute a one-off export for a post
  • Perform a custom workflow step in admin

Field Preview #

A primary button with optional confirmation, plus a spinner and message area.

How to Use #

  1. Add the Action Button field to a Field Group.
  2. Set Button label and Action slug.
  3. (Optional) Enable confirmation and set the message.
  4. (Optional) Set a required capability.
  5. Set Lock seconds to prevent rapid repeats.
  6. Save the Field Group and use the button in the editor.

Field Settings #

SettingDescriptionDefault
Button labelText displayed on the buttonRun action
Action slugUnique identifier for the actionEmpty
Enable confirmationShow a confirmation prompt0
Confirmation messageMessage shown in the confirmation promptAre you sure?
Required capabilityOptional capability checkEmpty
Lock secondsPrevents rapid repeated triggers15

Value & Storage #

Saved as: Post meta (no value)

Storage type: null

Return format: null

REST format: not specified

Important details:

  • This field does not store any value.
  • Output from get_field() is always null.

Output Examples #

PHP #

$value = get_field('my_action_button');
if ($value === null) {
    // No stored value for this field.
}

Compatibility #

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

Hooks (Developer) #

Hooks Summary #

HookTypePurpose
custom_fields_booster_button_action_defaultsFilterModify default settings.
custom_fields_booster_button_action_supportsFilterModify ACF support flags.
custom_fields_booster_button_action_before_settingsActionRun logic before rendering settings UI.
custom_fields_booster_button_action_after_settingsActionRun logic after rendering settings UI.
custom_fields_booster_button_action_before_enqueueActionRun logic before enqueuing assets.
custom_fields_booster_button_action_after_enqueueActionRun logic after enqueuing assets.
custom_fields_booster_button_action_before_renderActionRun logic before rendering UI.
custom_fields_booster_button_action_after_renderActionRun logic after rendering UI.
custom_fields_booster_button_action_update_valueFilterModify the value before saving.
custom_fields_booster_button_action_load_valueFilterModify the value after loading.
custom_fields_booster_button_action_validate_valueFilterModify validation result.
custom_fields_booster_button_action_format_valueFilterModify value returned by get_field().

Filters #

Filter: custom_fields_booster_button_action_defaults

Purpose: Override default settings.

When: You want consistent defaults across all Action Button fields.

add_filter('custom_fields_booster_button_action_defaults', function ($defaults) {
    $defaults['lock_seconds'] = 30;
    return $defaults;
});

Filter: custom_fields_booster_button_action_supports

Purpose: Control ACF supports such as required or escaping behavior.

When: Your project needs different support flags.

add_filter('custom_fields_booster_button_action_supports', function ($supports) {
    $supports['required'] = false;
    return $supports;
});

Filter: custom_fields_booster_button_action_update_value

Purpose: Modify the value before saving.

When: You want to modify the stored output (always null by default).

add_filter('custom_fields_booster_button_action_update_value', function ($value, $post_id, $field, $field_instance) {
    return $value;
}, 10, 4);

Filter: custom_fields_booster_button_action_load_value

Purpose: Modify the value after loading.

When: You want to customize the returned value.

add_filter('custom_fields_booster_button_action_load_value', function ($value, $post_id, $field, $field_instance) {
    return $value;
}, 10, 4);

Filter: custom_fields_booster_button_action_validate_value

Purpose: Modify validation result.

When: You need custom validation logic.

add_filter('custom_fields_booster_button_action_validate_value', function ($valid, $value, $field, $input, $field_instance) {
    return $valid;
}, 10, 5);

Filter: custom_fields_booster_button_action_format_value

Purpose: Modify value returned by get_field().

When: You want to change the return value.

add_filter('custom_fields_booster_button_action_format_value', function ($value, $post_id, $field, $field_instance) {
    return $value;
}, 10, 4);

Actions #

Action: custom_fields_booster_button_action_before_render

Runs before rendering the field UI.

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

Action: custom_fields_booster_button_action_after_render

Runs after rendering the field UI.

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

Assets #

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

  • admin/js/cfb-field-button-action.js

REST API #

Schema: not specified

REST Validation #

Standard ACF validation only.

Security & Escaping #

  • Output escapes all attributes and the button label.
  • No value is saved or formatted.

Notes / Limitations #

  • This field requires a custom handler for the action slug (client/server).

Changelog #

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

Was the documentation helpful?

  • Happy
  • Normal
  • Sad
ChecklistAddress
Table of Content
  • Use Cases
  • Field Preview
  • How to Use
  • Field Settings
  • Value & Storage
  • Output Examples
    • PHP
  • 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.