• Resolved igornn

    (@igornn)


    Hi,
    i work with this plugin in many restaurant sites.
    i have multisite, so each time i active restaurant-reservations plugin i need to do the same things:

    1. change all the settings (the same settings to all sites).
    2. set all notifications with my text

    the question is how can change settings and notifications by code? on plugin activation?
    * maybe some hook/filter?

    and if there is some way to import/export its also can be great!

    any suggestion to save time?

    Thanks

    https://ww.wp.xz.cn/plugins/restaurant-reservations/

Viewing 1 replies (of 1 total)
  • Hi igornn,

    All of the plugin’s settings are stored in a single row in the wp_options table. If you’re comfortable writing SQL queries directly, you’ll find all the settings serialized in the appropriate options table (wp_2_options, wp_3_options, etc) under the option name rtb.

    If you don’t want to do that, you can try using some of the WordPress multisite functions to fetch the value from one site and insert it for another site. If you have settings for site ID 2 and you want to insert them in a new site, you’d run the following code on the new site:

    switch_to_blog( 2 );
    $rtb_options = get_option( 'rtb' );
    restore_current_blog();
    update_option( 'rtb', $rtb_options );

    I have not tested this, so please make sure you’ve backed stuff up before running the code. Or better yet, run it in a development environment first.

Viewing 1 replies (of 1 total)

The topic ‘import/export plugin settings’ is closed to new replies.