Skip to content

Instantly share code, notes, and snippets.

Last active May 21, 2021 11:44
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
[Shield Security for WordPress] Filter whether the Plugin Security Badge is displayed
* 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:
* 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