Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.