Skip to content

Instantly share code, notes, and snippets.

@wpspeak
Created October 15, 2014 15:25
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 wpspeak/261db7c594640812c5d9 to your computer and use it in GitHub Desktop.
Save wpspeak/261db7c594640812c5d9 to your computer and use it in GitHub Desktop.
Edit or Remove "Protected" and "Password Protected" from Post Titles
<?php
//* Remove "Private: " from Private Post Titles
function wpspeak_format_post_title($content) {
return '%s';
}
add_filter('private_title_format', 'wpspeak_format_post_title');
<?php
//* Remove "Password Protected: " from Password Protected Post Titles
function wpspeak_title_format_post_title($content) {
return '%s';
}
add_filter('protected_title_format', 'wpspeak_format_post_title');
<?php
//* Remove both "Private: " and "Password Protected: " from Post Titles
function wpspeak_title_format_post_title($content) {
return '%s';
}
add_filter('private_title_format', 'wpspeak_format_post_title');
add_filter('protected_title_format', 'wpspeak_format_post_title');
<?php
//* Replace "Private: " from Private Post Titles
function wpspeak_format_post_title($content) {
return 'Confidential: %s';
}
add_filter('private_title_format', 'wpspeak_format_post_title');
<?php
//* Replace "Password Protected: " from Password Protected Post Titles
function wpspeak_title_format_post_title($content) {
return 'Confidential: %s';
}
add_filter('protected_title_format', 'wpspeak_format_post_title');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment