Tag Info

New answers tagged

0

It turns out it was a bug after all: one of my plugin options is a textfield in which the user can specify a message. It is provided with a default value, but that user chose not to have any message, so emptied it. It looked ok on the backend (field looked empty), but when i looked into the database it had become zillions and zillions of "\" signs! This ...


0

The problem here was caused because I was using a sanitize callback declared in register_settings() (the on_save_chages() function below). This callback will ultimatly update the database with whatever value is returned, creating the fgw_login key if it does not exist. To ensure that I always had my default empty array if required I made the following ...


0

500 errors can be for many reasons. In context of submitting form they are more common because of security setup, typically mod_security. It tends to have strict rules for form submissions / POST requests. There isn't much you can do about it really. At one host in the past I needed to ask support to disable some mod_security rules, because I couldn't even ...


1

I have tested your code and it is working fine. I hope you are checking the field on the right place. It should be and it is under Settings > General in your WordPress admin Just used the given code


0

When you call register_setting, the third parameter is the sanitize callback function. You can do whatever data manipulation you need in that function, in order to arrange the user input into the format you need for your code. So after the data validation (integers are integers, sanitize text fields, etc.), you can retrieve the current option value and add ...



Top 50 recent answers are included