-
-
Save 2ndkauboy/1e98df1061ea642b47644d59a85c84e6 to your computer and use it in GitHub Desktop.
Removes the word "private" and "protected" from the posts title.
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 | |
/** | |
* Remove Private and Protected Title Prefix | |
* @package RemovePrivateAndProtectedTitlePrefix | |
* @author Bernhard Kau | |
* @license GPLv3 | |
* | |
* @wordpress-plugin | |
* Plugin Name: Remove Private Title Prefix | |
* Plugin URI: https://kau-boys.de | |
* Description: Removes the word "private" and "protected" from the posts title. | |
* Version: 0.1 | |
* Author: Bernhard Kau | |
* Author URI: https://kau-boys.de | |
* License: GPLv3 | |
* License URI: http://www.gnu.org/licenses/gpl-3.0.txt | |
*/ | |
/** | |
* Remove the "Private" and "Protected" prefix from headlines | |
* | |
* @param string $content Text displayed before the post title. Default 'Private: %s'. | |
* | |
* @return string | |
*/ | |
function remove_private_and_protected_prefix_title_format( $content ) { | |
return '%s'; | |
} | |
add_filter( 'private_title_format', 'remove_private_and_protected_prefix_title_format' ); | |
add_filter( 'protected_title_format', 'remove_private_and_protected_prefix_title_format' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment