I created a plugin you can see here: http://wordpress.org/plugins/vegas-fullscreen-background-slider/

Some users are saying that settings aren't saving. For me it's working fine but I'm fairly new to php and absolutely new to the settings api, so I'm just wondering if I did something wrong or incorrectly that could be leading to this? Though ike I said, it's working just fine for me that's why I'm confused...

Here's the pastebin of my options.php: http://pastebin.com/aSgmY42r


Here are few remarks after skimming through your code:

  • you are using options name like id, title and global. You should use a prefix on these names, like vegas_, to avoid possible problems with other stuff using these option names.

  • you should let the users know about validation problems (check out the add_settings_error() function)

  • use trim() on your text fields values when you save.

  • use esc_attr() to escape your HTML attributes.

  • develope your plugin with WP_DEBUG activated, so you can catch any errors before you ship your plugin.

Hopefully this will bring you closer to a resolution ;-)





Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.