WP_REST_Posts_Controller::protected_title_format() WordPress Method

The WP_REST_Posts_Controller::protected_title_format() method is used to format the post title for display when the post is protected by a password. This method is used by the_title() function when the post is protected by a password. The method allows the post title to be displayed in a special format when it is password protected.

WP_REST_Posts_Controller::protected_title_format() #

Overwrites the default protected title format.


Description

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.


Top ↑

Return

(string) Protected title format.


Top ↑

Source

File: wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php

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

Top ↑

Changelog

Changelog
VersionDescription
4.7.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.