Customise the contents and styles of Shield Security Plugin Badge
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 | |
/** | |
* The plugin badge array has 5 attributes represented by the following keys: | |
* name, url, logo, protected_by, custom_css | |
* | |
* This filter is only available is the plugin is activated for ShieldPRO. | |
* | |
* You may also use your Whitelabel settings to overwrite many of the defaults: | |
* See: https://icontrolwp.freshdesk.com/support/solutions/articles/3000078466 | |
*/ | |
add_filter( 'icwp_shield_plugin_badge_attributes', function ( $badgeAttributes, $isFloating ) { | |
/** | |
* Set the text to replace "This site is protected by Shield." | |
*/ | |
$badgeAttributes[ 'protected_by' ] = 'Shield is keeping you safe'; | |
/** | |
* Add custom CSS - e.g. set the background colour to yellow | |
*/ | |
$badgeAttributes[ 'custom_css' ] = '#icwpWpsfSiteBadge{ background-color: yellow; }'; | |
// ALWAYS return $badgeAttributes. | |
return $badgeAttributes; | |
}, 10, 2 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment