Home › Forums › Backend Issues (wp-admin) › Got false bool when using update_field() › Reply To: Got false bool when using update_field()
Thanks for responding Sam! So I’m currently trying to update the field with text input from a key and value input text box when a submit button is being pressed in an admin menu page. The field I’m trying to update is a text area. Here is the code:
<form action="" method="POST">
<input type="text" name="key" id="key">
<input type="text" name="value" id="value">
<input type="submit" name="Submit" value="send" >
</form>
<?php
if(isset($_POST['Submit']))
{
$key = $_POST["key"];
$value = $_POST["value"];
$array = array($key,array($value));
$out = json_encode($array);
update_field('field_key',$out);
}
?>
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.