I am trying to export the plugin options that I created.
if(!get_option('myplugin_opts') ){
add_option('myplugin_opts');
}
and also I want to know how I could import the options to WordPress for my plugin, thanks
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It only takes a minute to sign up.
Sign up to join this communityI am trying to export the plugin options that I created.
if(!get_option('myplugin_opts') ){
add_option('myplugin_opts');
}
and also I want to know how I could import the options to WordPress for my plugin, thanks
get_option($name)
on all your keys, or extracting them fromwp_load_alloptions()
array if they're autoloaded options (default). Make a JSON file or just string and download it, read it later and useset_option($name, $value)
to import each option individually.