Home › Forums › Bug Reports › Can not save empty text field › Reply To: Can not save empty text field
If you’re still around, let’s find out it the value is getting to WP or if the value is being removed before WP is loaded.
This will require a bit of hacking, but sometimes it’s necessary. You didn’t say, so I am assuming that the field is on a “post” edit screen, if not let me know.
Step 1) Open the page/post where the field is not submitting the empty value. Make sure the field has a value and save the post. Leave the browser open on this page while you do the next step.
Step 2) Open the file /wp-admin/post.php, the top of the file should look something like this.
<?php
/**
* Edit post administration panel.
*
* Manage Post actions: post, edit, delete, etc.
*
* @package WordPress
* @subpackage Administration
*/
/** WordPress Administration Bootstrap */
Just after the opening PHP tag add this
<?php
echo '<pre>'; print_r($_POST); die;
/** .....
Step 3) Go back to the browser and remove the value from the field and then click update post. You should get see the submitted array of values. Is the field that you are trying to clear there and does it have an empty string as a value?
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!
ACF wouldn’t be so widely used in WordPress if it didn’t have some pretty amazing capabilities. In this article, we look at a few of the features we’ll discuss during “7 things you didn’t know you could do with ACF” at #WPEDecode later this month. https://t.co/5lnsTxp81j pic.twitter.com/Yf0ThPG1QG
— Advanced Custom Fields (@wp_acf) March 16, 2023
© 2023 Advanced Custom Fields.
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.