Retrieve post title.

If the post is protected and the visitor is not an admin, then “Protected” will be displayed before the post title. If the post is private, then “Private” will be located before the post title.

Signature

get_the_title( $post = 0 )
post
 (int|WP_Post) Optional. Post ID or WP_Post object. Default is global $post.
Default: 0

Return

(string)

Source

function get_the_title( $post = 0 ) {
	$post = get_post( $post );

	$title = isset( $post->post_title ) ? $post->post_title : '';
	$id = isset( $post->ID ) ? $post->ID : 0;

	if ( ! is_admin() ) {
		if ( ! empty( $post->post_password ) ) {

			/**
			 * Filter the text prepended to the post title for protected posts.
			 *
			 * The filter is only applied on the front end.
			 *
			 * @since 2.8.0
			 *
			 * @param string  $prepend Text displayed before the post title.
			 *                         Default 'Protected: %s'.
			 * @param WP_Post $post    Current post object.
			 */
30 more lines...
WP Trac GitHub

Link here