Last active
May 21, 2021 11:44
-
-
Save paulgoodchild/b8a04d90fde14520b94854d7c5bd20b6 to your computer and use it in GitHub Desktop.
[Shield Security for WordPress] Filter whether the Plugin Security Badge is displayed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Note: Only available from Shield v11.2+ | |
* | |
* Use this filter to tell Shield whether or not the Plugin Security Badge should be displayed or not. | |
* | |
* More Info on badge here: https://getshieldsecurity.com/blog/feature-plugin-badge/ | |
* | |
* For example, you may only want to show the badge if the visitor is not on a mobile (see below). | |
* | |
* Note, by using `$show &&` we honour the current setting within the plugin first and foremost. | |
*/ | |
add_filter( 'shield/show_security_badge', function ( $show ) { | |
$show = $show && !wp_is_mobile(); | |
// ALWAYS return $show. | |
return $show; | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment