Support

Account

Home Forums General Issues Miscellaneous ACF Programming Questions

Unread

Miscellaneous ACF Programming Questions

  • Hello, everyone.
    First, my apologies if these questions have been asked a million times before. My searches have not been fruitful.

    Anyway, I’ve been using ACF mostly to do frontend stuff, but I’ve recently thought of venturing to some backend API.

    So here are my questions:

    1. Let’s say I have two field groups (Customers and Suppliers) with their own set of fields. Is there a way to have functions in my functions.php file target only specific field groups? For example, I want the function below to only fire when I’m adding new entries to the Customers field group.

    add_filter('acf/save', 'add_client');
    function add_client($post_id) {
    ...
    }
    

    2. Other than ‘acf/save’, is there another way to fire an action? Say there’s a select field and I want a textarea to get filled with text based on the user’s selection.

    3. How can I do a var_dump or print_r on the backend if I’m troubleshooting? What I’ve been doing is using update_field() on a textarea.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.