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

Stephane Daury wordpress at tekartist.org
Thu Apr 3 16:36:09 GMT 2008


That also mean one cannot use update_option() to switch the state of  
the autoload flag when needed.

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



On Apr 03, 2008, at 11:39, Stephane Daury wrote:

> 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/
>
>
>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list