How to create global options in Wordpress?

I use WPMU, but there are some parameters that the administrator must set and must affect each user of the website. Does Wordpress have a place to store these global options? Can someone give me some sample code?

Thanks!

+4
source share
2 answers

My first instinct is to create my own table to store these parameters. Then you have full control over where, where and by whom the data is available ... globally through all your MU blogs.

Regarding the sample code, I suggest starting with codex or trying to get through this tutorial .

+1
source

Starting with Wordpress 3.0, you can use add_site_option, update_site_option and get_site_option to get an option from a blog with a specific identifier. Therefore, just save all the administrator settings on one site, save this site identifier as a constant, and then get all the options.

http://codex.wordpress.org/WPMU_Functions/get_site_option

+2
source

Source: https://habr.com/ru/post/1307967/


All Articles