I'm new to PHP and WordPress, but I have some experience with python, for my site I use the traveller theme.

How can I find the exchange rate variable that exists in theme settings (the red square on the screenshot)? I need to change it automatically with another function, not manually via theme settings.

What are possible ways to find such variable, or is there any convention where all theme variables stored?

The only closest piece of code I found is on screenshot #2 (wp-content/themes/traveler/inc/st-theme-options.php), but I'm not sure if that's what I need & how to reassign it. Thanks

theme settings screenshot

enter image description here


Plugin options are normally stored in the wp_options table. If you look at the plugin code (and reference the Plugin information in Codex; you can start here: https://codex.wordpress.org/Writing_a_Plugin ), you will see how the plugin names the option. Then you can create a function that will change that option value.

Note that most plugins store their options in one row of wp_options table, so you will need to make sure you don't bork the other options that the plugin uses.

You might also want to contact the plugin's support area, which is the proper place for questions about plugins.

  • Yes, I've found what I needed in wp_options table thanks! But now I can't figure out how to edit simple digit in there, because it's stored as long string inside. Part of it looks like '{s:5:"title";s:3:"EUR";s:4:"name";s:3:"EUR";s:6:"symbol";s:3:"€";s:4:"rate";s:1:"1";' Seems like some markup language, what is the best/right way to manipulate with it? for example I need to change "1" to "1.5" after rate";s:1: Thanks! – Denis Tarnavsky Oct 4 '18 at 12:50
  • Actually, that is an array stored in a single field. You could read the options into a variable and print it out with a var_print so you can see the array's elements. Take a look at this page in the Codex to see how options are stored and retrieved. developer.wordpress.org/plugins/settings/options-api . – Rick Hellewell Oct 4 '18 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.