update_option

update_option ( $option, $newvalue )

Parameters:
  • (string) $option Option name. Expected to not be SQL-escaped.
  • (mixed) $newvalue Option value. Expected to not be SQL-escaped.
Uses:
Returns:
  • (bool) False if value was not updated and true if value was updated.
Defined at:

Description

Update the value of an option that was already added.

You do not need to serialize values. If the value needs to be serialized, then it will be serialized before it is inserted into the database. Remember, resources can not be serialized or added as an option.

If the option does not exist, then the option will be added with the option value, but you will not be able to set whether it is autoloaded. If you want to set whether an option is autoloaded, then you need to use the add_option().

Related Functions

update_blog_option, update_site_option, update_user_option, delete_option, populate_options

Top Google Results

User discussions

wpseek mobile