Skip to content

Instantly share code, notes, and snippets.

@johnalarcon
Last active January 30, 2019 04:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnalarcon/ef83d7dd6ba11ac92795d2fa8256c43f to your computer and use it in GitHub Desktop.
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.
<?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