I must set choices of a selected plugin on the guardian web site of a community and use these settings globally to override every web site, except set to false
.
Neither get_option()
or get_site_option()
does the duty. They simply return values relative to the present web site. All of the options I’ve encountered are strategies to make use of database question with $wpdb->get_results()
however I determine the mighty WP will need to have a built-in technique to do that activity.
Instance use
- Plugin setting to show advert banner set to
true
at guardian web site - The plugin is on the market throughout the community to insert banners however can’t be disabled as a result of the situation solely accepts the guardian worth except set to
false
code state of affairs (not an precise WP perform)
if( get_parent_site_option('adbanners')['show_banners'] == 1 ) {
showAds();
}else
if( get_site_option('adbanners')['show_banners'] == 1 ) {
showAds();
}else{
// advertisements disabled on this present web site
}
Is there a WP perform to do that with out the direct DB question technique?