Skip Navigation

[Resolved] Unable to add new custom fields to CPT

This thread is resolved. Here is a description of the problem and solution.

Problem:

Try to in crease "max_input_vars" by adding code into wp-config.php

@ini_set( 'max_input_vars' , 4000 );

But it does take effect.

Solution:

In my localhost, the MaxInputVars is 2500, you can check it with your server provider, check how to increase MaxInputVars settings to 4000 or above in your webserver.

Relevant Documentation:

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 7 replies, has 2 voices.

Last updated by larryL 4 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1712161

I am trying to add a new select field to an existing custom post type's custom field group. Each time I click save it disappears. IOW, the new field that I add (after I save) disappears. I've tried downgrading my theme, switching to 2017, downgrading Types, deactivating plugins, etc... nothing works. I also tried increasing @ini_set( 'max_input_vars' , 4000 );

I don't know what else to do.

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/s3361/html/wp-content/themes/Divi/includes/builder/functions.php on line 5917

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/s3361/html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/wpml.php on line 650

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in /home/s3361/html/wp-content/plugins/types/vendor/toolset/types/embedded/includes/wpml.php on line 667
I'm using Divi.

Please help.

Thanks!

#1712257
select3.JPG

Hello,

I can login your website, but I don't see the problem you mentioned above:

I am trying to add a new select field to an existing custom post type's custom field group. Each time I click save it disappears.

I did test it here:
hidden link

Add a select field, and save, it works fine, see my screenshot: select3.JPG

And there was an similar issue about PHP version 7.3, which has already been fixed in latest version of Toolset Types plugin:
https://toolset.com/errata/php-7-3-shows-warnings-about-continue-statement-in-types/

Since you are using the latest version of Toolset Types plugin, it should not be an issue.

Please provide detail steps to duplicate the same problem, and provide a database dump file of your website in below private message box, you can put duplicator package file in your own google drive disk, share the link only, thanks

#1712279
#1712293

Thanks for the details, I can see the problem in your website, I am downloading the files, will update here if find anything

#1712357
select4.JPG

I have installed a new webserver(PHP 7.3.12) in my localhost, and import your database dump file in my localhost in a fresh WP installation + the latest version of Toolset plugins, it works fine, I can add the select field , and save the field group without any problem, see my screenshot: select4.JPG

So there should be other compatibility/server issue in your website, please try these:
In case it is a compatibility problem, please deactivate all other plugins, and switch to wordpress default theme 2020, deactivate all custom PHP/JS code snippets, and test again

if you need more assistance to locate the problem, please provide your website FTP access in below private message box, I need to test and debug it in a live website.

#1713357
#1713365

Thanks for the details, I can login with the sftp access, please backup your website first, then update here, I need deactivate plugins/theme in your website,

#1713383

The site is backedup daily.

#1713413

Thanks for the details, please check these:
Dashboard-> Toolset-> Settings, at the page bottom, click link "Toolset Debug Information and Troubleshooting":
hidden link

The "MaxInputVars" settings is still 1000, so the setting "@ini_set( 'max_input_vars' , 4000 )" in wp-config.php does not work in your webserver.

In my localhost, the MaxInputVars is 2500, you can check it with your server provider, check how to increase MaxInputVars settings to 4000 or above in your webserver.

And I suggest you try to upgrade your webserver PHP version to latest version, for example PHP 7.3.20:
hidden link

#1715471

My issue is resolved now. Thank you!