Skip to content
No results
  • Start
  • Services
  • Blog
  • Contact
  • Tools
  • Plugins
    • AR Model Viewer for WooCommerce
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Metaly for ACF and SCF
    • Rafly – Raffles to WooCommerce
    • Reelify
    • Ticket Sales and Scan QR
    • Wizard Cart Import
LinkedIn GitHub WordPress WhatsApp TikTok
LinkedIn GitHub WordPress WhatsApp TikTok
racmanuel.dev
  • Start
  • Services
  • Blog
  • Contact
  • Tools
  • Plugins
    • AR Model Viewer for WooCommerce
    • Flow POS – Free WooCommerce POS Plugin (Point of Sale for WordPress)
    • Metaly for ACF and SCF
    • Rafly – Raffles to WooCommerce
    • Reelify
    • Ticket Sales and Scan QR
    • Wizard Cart Import
Contact
racmanuel.dev

AR Model Viewer for WooCommerce

4
  • Getting Started
  • Description
  • Requirements
  • 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 label.Text displayed on the button.Run action.
Action slug.Unique identifier for the action.Empty
Enable confirmation.Show a confirmation prompt.0
Confirmation message.Message shown in the confirmation prompt.Are you sure?
Required capability.Optional capability check.Empty
Lock seconds.Prevents rapid repeated triggers.15

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 #

JavaScript #

$value = get_field('my_action_button');

Compatibility #

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

Hooks (Developer) #

Hooks Summary #

HookTypePurpose
custom_fields_booster_button_action_defaults.FilterModify default settings.
custom_fields_booster_button_action_supports.FilterModify ACF support flags.
custom_fields_booster_button_action_before_settings.ActionRun logic before rendering settings UI.
custom_fields_booster_button_action_after_settings.ActionRun logic after rendering settings UI.
custom_fields_booster_button_action_before_enqueue.ActionRun logic before enqueuing assets.
custom_fields_booster_button_action_after_enqueue.ActionRun logic after enqueuing assets.
custom_fields_booster_button_action_before_render.ActionRun logic before rendering UI.
custom_fields_booster_button_action_after_render.ActionRun logic after rendering UI.
custom_fields_booster_button_action_update_value.FilterModify the value before saving.
custom_fields_booster_button_action_load_value.FilterModify the value after loading.
custom_fields_booster_button_action_validate_value.FilterModify validation result.
custom_fields_booster_button_action_format_value.FilterModify 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 by default). null (Line omitted as it is a continuation of 50; kept as standalone per original format) 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 admin/js/cfb-field-button-action.js). acf_form()):

  • (Line omitted as it is a continuation of 57; kept as standalone per original format) 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
    • JavaScript
  • Compatibility
  • Hooks (Developer)
    • Hooks Summary
    • Filters
    • Actions
  • Assets
  • REST API
  • REST Validation
  • Security & Escaping
  • Notes / Limitations
  • Changelog

racmanuel.dev

We help your business grow through customized technology solutions. We specialize in developing tools that optimize processes, increase efficiency, and generate visible results.

Contact Information

  • Telephone: +52 (444) 380 57 40
  • WhatsApp: +52 (444) 380 57 40
  • Email: developer@racmanuel.dev
  • Address: 78250 San Luis Potosí, SLP, San Luis Potosí, Mexico
  • Start
  • Services
  • Blog
  • Contact
  • Tools
  • Plugins

Copyright © 2024. Made with ❤️ WordPress.

Spanish