Export WP-Discourse config?


(Coin-coin le Canapin) #1

Hi. Is there any way to export/import WP-Discourse config (as a JSON file for example)? If not, do you have some plan to do such a feature?


(Simon Cossar) #2

The plugin’s configuration is all stored in the WordPress options table, so you can access it that way. If you look at the initialize_plugin function and the discourse_option_groups array in this file wp-discourse/discourse.php at master · discourse/wp-discourse · GitHub you can see how the options are put together. It wouldn’t be too hard to write a script to initialize the options on a site by populating the arrays that are named in the discourse_option_groups array and then calling wp_update_option( $array_name, $array_values) for each of the arrays.

There are no plans to made the plugin’s configuration downloadable. If you are dealing with this, you need to be very careful about the API credentials.