rpress_update_option()

Author: bibhu 372 views

Options specific to restropress are stored in an array in a single WordPress option. For this reason, it’s best to use rpress_update_option() to change those options. rpress_update_option() safely filters and updates an existing option.

Input

rpress_update_option() takes two input variables. The first is the key name of the option desired.  The second is the value that should be stored in the option. The second value defaults to false. Example:

rpress_update_option( $key = '', $value = false )

Usage

Here’s an example, updating the position of the currency indicator.  By default it’s set to ‘before’, this example will set it to ‘after’.

rpress_update_option( 'currency_position', 'after' );

Output

This function returns true if the option is updated, otherwise false.