Skip to content

Instantly share code, notes, and snippets.

Last active December 20, 2015 00:29
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
#12: protected_title_format
* 'Members Only' title for 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_members_only_label( $protected ) {
// The %s specifier is replaced with
// the post title after the filter is evaluated.
return __( 'Members Only: %s', 'yourtextdomain' );
add_filter( 'protected_title_format', 'wpdocs_members_only_label' );
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment