[resolved] multisite settings page, saving data in db - can wp api handle this (4 posts)

  1. munrobr
    Posted 4 years ago #

    I've got a multisite install:
    I'm looking for wp api to handle a settings page I've created to track and config in-house plugins (has its own top level menu link and sub menus)

    I've used http://ottopress.com/2009/wordpress-settings-api-tutorial/ to take a stab at this, but I feel as though it's only for single site? Either that or I haven't set it up properly, but I've gone through the whole thing multiple times and there's no db update or anything.

    Originally I had it linked to options.php, but obviously as it's a network settings page the page was not found. I removed the options.php and let it just post back to the current custom settings page. Will the functions not fire this way? Is that my problem? I'm pretty new to WP and php, so I'm a bit lost here.

    Any help would be appreciated.

  2. ericktedeschi
    Posted 4 years ago #

    The functions get_site_option, update_site_option, delete_site_option and add_site_option can be used to write settings valid in all network.
    My plugin User Security Tools makes use of this functions.


    This functions are in wp-include/functions.php

  3. munrobr
    Posted 4 years ago #

    This is a great help. Definitely steered me in the right direction.

    For anyone else looking to accomplish the whole register_settings thing on a multisite I definitely recommend the mentioned plugin for guidance. I also took a quick look based on what you said and found a neat tutorial:

    edit: Just to clarify this is used instead of the register settings.

    Thanks for the help!

  4. francismaile
    Posted 3 years ago #

    So for multisite plugins, you don't use the Settings API?

Topic Closed

This topic has been closed to new replies.

About this Topic