W3cubDocs

/WordPress

WP_REST_Post_Search_Handler::protected_title_format(): string

Overwrites the default protected and private title format.

Description

By default, WordPress will show password protected or private posts with a title of "Protected: %s" or "Private: %s", as the REST API communicates the status of a post in a machine-readable format, we remove the prefix.

Return

string Title format.

Source

public function protected_title_format() {
	return '%s';
}

Changelog

Version Description
5.0.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/classes/wp_rest_post_search_handler/protected_title_format