[wp-hackers] WP option set bug (or at least discrepancy)

Stephane Daury wordpress at tekartist.org
Thu Apr 3 15:39:55 GMT 2008


Hey all,

There's a nasty discrepancy between the core codebase and the codex in  
regards to the update_option() function.

http://codex.wordpress.org/Function_Reference/update_option

In the above docs, the advertised params are :
- $name
- $value
- $description
- $autoload

But in the code (wp-includes/functions.php), the specs actually are  
update_option($option_name, $newvalue)

The main issue with this is that (as far as I know), everybody uses  
update_option over add_option, since the docs (and code) states:
"This function can be called even if the option does not exist, the  
function will create the option. ".

It's an immediate issue for me that gonna be a big drag, because I now  
need to check if the option exists, then use add or update, since I  
need to set the autoload flag.
Not the end of the world, but I thought I'd mention it before editing  
the codex page.

Is there something I'm missing?!?

Stephane




---
Stephane Daury - http://tekartist.org/





More information about the wp-hackers mailing list