Support

Account

Home Forums Backend Issues (wp-admin) Creating a button to update field

Helping

Creating a button to update field

    • mikbio

    • May 6, 2019 at 11:54 pm

    Hello,
    on my website i have just 1 custom field, created for user profiles. This field holds a numeric value that i need to update monthly.
    At the moment i need to go in every user profile and update this manually, but i would like to achieve two things.

    1. Reset to 0 that field in every user profile with one click.
    2. Have a timed reset in a specific date of the month, basically on a selected day i would like those field to reset to 0.

    Reading some ACF documentation i understood that i need to use the update_field() function, the fact is that i’m not a big expert in wordpress, so i don’t really know ho to call that function so that me an other admins could reset that field just clicking a button.

    Thanks to everyone, i really hope someone can help me

  • I think this has to do with another question and I already answered reset on date question.

    As far as a button to do the reset, you would need to create an admin page with a button on it. This button would have a JavaScript action attached to it. This JavaScript would run an AJAX request that would do the same thing as described for the other question https://support.advancedcustomfields.com/forums/topic/reset-custom-field-at-target-date/

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.