Skip to content

Instantly share code, notes, and snippets.

@sheabunge
Forked from WerdsWords/protected_title_format.php
Last active December 20, 2015 00:39
Show Gist options
  • Save sheabunge/6043774 to your computer and use it in GitHub Desktop.
Save sheabunge/6043774 to your computer and use it in GitHub Desktop.
Removes the 'Members Only' title prefix from password-protected posts.
<?php
/**
* Removes the 'Members Only' prefix from password-protected posts
*
* @see get_the_title()
*
* @param string $protected Text prefixed to the title for password-protected posts.
*
* @return string The filtered prefix text.
*/
function wpdocs_remove_members_only_label( $label ) {
// The %s specifier is replaced with
// the post title after the filter is evaluated.
return '%s';
}
add_filter( 'protected_title_format', 'wpdocs_remove_members_only_label' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment