_wp_privacy_settings_filter_draft_page_titles()
Appends '(Draft)' to draft page titles in the privacy page dropdown so that unpublished content is obvious.
Internal function — this function is designed to be used by the kernel itself. It is not recommended to use this function in your code.
No Hooks.
Returns
String. Page title.
Usage
_wp_privacy_settings_filter_draft_page_titles( $title, $page );
- $title(string) (required)
- Page title.
- $page(WP_Post) (required)
- Page data object.
Changelog
| Since 4.9.8 | Introduced. |
_wp_privacy_settings_filter_draft_page_titles() wp privacy settings filter draft page titles code WP 7.0.1
function _wp_privacy_settings_filter_draft_page_titles( $title, $page ) {
if ( 'draft' === $page->post_status && 'privacy' === get_current_screen()->id ) {
/* translators: %s: Page title. */
$title = sprintf( __( '%s (Draft)' ), $title );
}
return $title;
}