Hey @silsbyc,
Yes you can do this by using this code which will always force set the option.
add_filter(
'option_wpcode_settings',
function ( $settings ) {
if ( ! is_array( $settings ) ) {
$settings = array();
}
$settings['headers_footers_mode'] = true;
return $settings;
}
);
Keep in mind that we intend to build more robust access control and features for Multisite which I know will be very beneficial for administration / network wide customization.
If you enable this code above, then you won’t see those options and won’t be aware of those new powerful features.
So I recommend definitely checking in and keeping up with our development roadmap since we are working on some really neat stuff.
I can’t get the filter to work as a plugin or MU plugin (which is necessary since the original Insert Headers and Footers plugin was installed individually across different sites on the network).
Hi @silsbyc,
I see, in the multisite context the option was never defined on subsites so you have to use the pre_option_ filter instead. Please use this code in a mu-plugin:
add_filter(
'pre_option_wpcode_settings',
function ( $settings ) {
if ( ! is_array( $settings ) ) {
$settings = array();
}
$settings['headers_footers_mode'] = true;
return $settings;
}
);
Thank you!
With ‘pre_option_wpcode_settings’ the filter now works, and it continues to work the way my site admins expected it to work.