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


Creating a button to update field

  • 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

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

The topic ‘Creating a button to update field’ is closed to new replies.