Using filter for all plugin settings
-
Hi Robin, thanks for a great plugin! I use wordpress multisite, and although your default settings are pretty close to what I’d want, there are a few settings that I’d like to modify across my network.
add_filter('scriptlesssocialsharing_get_setting','scriptless_custom_settings',20,2); function scriptless_custom_settings($key){ if( array_key_exists('button_style',$key)){ $key['button_style'] = 0; $key['heading'] = 'updated heading'; return $key; } }
The filter does appear to change the settings, including updating the header, however for some reason when I use the filter the SVG icons stop working.
Here is the HTML from one of the buttons
<a class="button linkedin" target="_blank" href="...removed..." rel="noopener noreferrer nofollow"><svg class="scriptlesssocialsharing__icon linkedin" role="img" aria-hidden="true"> <use href="#linkedin" xlink:href="#linkedin"></use> </svg><span class="screen-reader-text">LinkedIn</span></a>
Any ideas why that filter might stop SVG output? Is there a different filter I should be using?
- The topic ‘Using filter for all plugin settings’ is closed to new replies.