I am trying to modify a plugin and in which i require to update a value in wp_options which has multiple values .
My option_name
is ws_mem_options
and the
option_value
has values such as in format
s:20:"pro_sp_email_subject";s:36:"Thank You! (instructions for access)";s:20:"mem_email_message";s:309:"Thanks %%first_name%%!
%%item_name%%
Transaction ID: %%txn_id%%
Charges today: $%%amount%%
Your order can be retrieved here:
%%sp_access_url%%
( link expires in %%sp_access_exp%% )
If you have any trouble, please feel free to contact us.
Best Regards,
Don't Just Watch TV, Participate!";s:120:"mem_coupon_codes";s:66:"CHRISTMAS-25|25%|01/01/2021
100%OFF|100%
SAVE-10|10%
dumpme|10%";s:15:"mem_default_tax";s:4:"0.0%";s:13:"mem_tax_rates";
how can i add more values to
s:120:"mem_coupon_codes";s:66:"wow-25|25%|01/01/2021
100%OFF|100%
now-10|10%
dumpme|10%";
What you are looking at is serialized data– possibly multiple bits of serialized data as @Rarst noted. The Options API will serialize and unserialize automatically so all you need to do is:
Reference
http://codex.wordpress.org/Function_Reference/get_option
http://codex.wordpress.org/Function_Reference/update_option
If you have access to run SQL queries, you can select the
option_value
you want to change and update it with newoption_value
by running an SQL query.