Support

Account

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);
    		}
    		?>