WordPress at a glance
function is not described

WP_REST_Post_Search_Handler::protected_title_format() WP 5.0.0

Overwrites the default protected title format.

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

This is a method of the class: WP_REST_Post_Search_Handler

No Hooks.


String. Protected title format.


$WP_REST_Post_Search_Handler = new WP_REST_Post_Search_Handler();
$var = $WP_REST_Post_Search_Handler->protected_title_format();


Since 5.0.0 Introduced.

Code of WP REST Post Search Handler::protected title format: wp-includes/rest-api/search/class-wp-rest-post-search-handler.php WP 5.2.2

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