Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress How to Build a WordPress Plugin Building a WordPress Plugin Settings Page CRUD with the WordPress Options Table

Sean Pascoe
Sean Pascoe
17,151 Points

update_option() creates database entries?

So it looks like you use update_option() to actually create the initial database entries. Is this standard procedure (versus add_option())? A little more explanation on the add/get/update/delete functions would've been helpful.

1 Answer

Yojance Rabelo
Yojance Rabelo
1,156 Points

It's just a safe way of saying if it hasn't been created yet, then go ahead and create it. In other words, update_option will first check to see if the option exists, if it doesn't exists, create it.