# wordpress-seo/trunk/src/bulk-editor/infrastructure/posts/post-title-trait.php

Yoast SEO – Advanced SEO with real-time guidance and built-in AI, version trunk. 31 lines.

- Page: https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/bulk-editor/infrastructure/posts/post-title-trait.php
- Raw: https://pluginprobe.com/plugins/wordpress-seo/trunk/raw/src/bulk-editor/infrastructure/posts/post-title-trait.php
- Modified: 2026-07-08T09:22:50+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/wordpress-seo/trunk/code/src/bulk-editor/infrastructure/posts/post-title-trait.php#L10-L20`.

```php
<?php

// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Yoast\WP\SEO\Bulk_Editor\Infrastructure\Posts;

/**
 * Produces the display title shared by both post collectors.
 */
trait Post_Title_Trait {

	/**
	 * Returns the post title for display in the bulk editor.
	 *
	 * The `the_title` filter run by get_the_title() can return HTML-encoded entities; they are
	 * decoded so the React table renders them as text. An empty title falls back to WordPress' own
	 * untitled-post convention, so the table and its accessible names always have text content.
	 *
	 * @param int $post_id The post ID.
	 *
	 * @return string The display title.
	 */
	protected function get_normalized_title( int $post_id ): string {
		$title = \html_entity_decode( \get_the_title( $post_id ), \ENT_QUOTES, 'UTF-8' );
		if ( $title === '' ) {
			return \__( '(no title)', 'wordpress-seo' );
		}

		return $title;
	}
}

```
