Last active
January 30, 2019 04:03
-
-
Save johnalarcon/ef83d7dd6ba11ac92795d2fa8256c43f to your computer and use it in GitHub Desktop.
Filter examples for the Username Protection plugin for ClassicPress. These code snips can be added to a functionality plugin or the functions.php file.
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 | |
// Change text used for display names in feeds. Default set by plugin is your site's name. | |
add_filter('codepotent_username_protection_feeds', 'codepotent_feeds'); | |
function codepotent_feeds($display_name) { | |
return $display_name; | |
} | |
// Change the REST API error message. Default set by plugin is "authentication required". | |
add_filter('codepotent_username_protection_rest_error', 'codepotent_rest_error'); | |
function codepotent_rest_error($error_text) { | |
return $error_text; | |
} | |
// Change commenters' display names. Defualt set by plugin is "Comment". | |
add_filter('codepotent_username_protection_comments', 'codepotent_comments'); | |
function codepotent_comments($display_name) { | |
return $display_name; | |
} | |
// Change default error text. Default set by plugin is "Login failed. Please try again." | |
add_filter('codepotent_username_protection_login_errors', 'codepotent_login_errors'); | |
function codepotent_login_errors($error_text) { | |
return $error_text; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment