Last active
December 20, 2015 00:29
-
-
Save WerdsWords/6042438 to your computer and use it in GitHub Desktop.
#12: protected_title_format
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 | |
/** | |
* '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' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
http://fotd.werdswords.com/protected_title_format/