Skip to content

Instantly share code, notes, and snippets.

@johnalarcon johnalarcon/functions.php
Last active Jan 30, 2019

What would you like to do?
Filter examples for the Username Protection plugin for ClassicPress. These code snips can be added to a functionality plugin or the functions.php file.
// 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
You can’t perform that action at this time.